Red Gregory

View Original

Notion Formula: Hours And Minutes Elapsed From Date Range

The Table Setup

The Formula

format(dateBetween(end(prop("Clock-In Clock-out")), start(prop("Clock-In Clock-out")), "hours")) + "hr " + format(dateBetween(end(prop("Clock-In Clock-out")), start(prop("Clock-In Clock-out")), "minutes") % 60) + "min"

The Formula Breakdown

  • format(dateBetween(end(prop("Clock-In Clock-out")), start(prop("Clock-In Clock-out")), "hours")) - find hours between the end of date range and start of date range, and format the result into a text value.

  • + “hr ” - add text value “hr. ”

  • format(dateBetween(end(prop("Clock-In Clock-out")), start(prop("Clock-In Clock-out")), "minutes") % 60) - find minutes between the end of date range and start of date range, mod 60 to the result, and format into a text value.

  • + “min” - add text value “min.”

View Example In Notion

See this content in the original post

See this gallery in the original post