Formula to calculate the number of weeks between start date & completion date

  • 1
  • 1
  • Question
  • Updated 12 months ago
  • Answered
I have a database which is used to track service.  Each engineer is assigned a service ticket with a start date and completion date.  I am trying to calculate the [Start Date] and [Completion Date] date into a week format (how many weeks from start to finish).  From that point, I would like to calculate how many weeks each engineer has worked and a total amount of weeks worked for all engineers
Photo of Carol Short

Carol Short

  • 164 Points 100 badge 2x thumb

Posted 12 months ago

  • 1
  • 1
Photo of Evan Martinez

Evan Martinez, Community Manager

  • 8,774 Points 5k badge 2x thumb
Hi Carol,

There is a formula function in Quick Base ToWeeks that will take a Duration and return how many weeks it contains. For example if you used ToWeeks(Days(14)) it would return the numeric value 2. Or in your example if you did ToWeeks([Completion Date]-[Start Date] It would turn that interval into a number of weeks (With anything less then a full week expressed in decimal places). You would just want to make sure that the Completion Date and Start Date field were both Date fields.

As you are building out your formulas we also have a formula function guide that points out some of the most commonly used formula functions and their use:

https://login.quickbase.com/db/6ewwzuuj?a=q&qid=6

I hope this suggestion is helpful Carol.
Photo of Carol Short

Carol Short

  • 164 Points 100 badge 2x thumb
Perfect!  That is exactly what I needed.