# Discussions

View Only

## Divide a number by duration field

• #### 1.  Divide a number by duration field

Posted 03-11-2020 13:21
I have a simple formula numeric field that i want to calculate ; formula below. The days in this invoice is a formula duration, getting error "Operator cant be applied on types number duration"

[Total]/[Days in this invoice]

------------------------------
Ermias Bean
------------------------------

• #### 2.  RE: Divide a number by duration field

Posted 03-11-2020 13:29
Try this

[Total]/ToDays([Days in this invoice])

------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------

• #### 3.  RE: Divide a number by duration field

Posted 03-11-2020 19:18
awesome, thanks, works

------------------------------
Ermias Bean
------------------------------

• #### 4.  RE: Divide a number by duration field

Posted 05-14-2020 16:34
Mark,

What if your duration field fluctuates duration...  Like some records are Hours but some are Days.

I have a formula duration that calculates the amount of time between 2 date/time fields.  Then I want to take that and multiply it by a currency.

4 days * 100
4 mins * 100

------------------------------
Amber Polston
------------------------------

• #### 5.  RE: Divide a number by duration field

Posted 05-14-2020 16:53
If your rate is say 100 per 24 day,  then you would convert to hours and then multiply.

Like

ToHours([my duration field]) * 100

------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------

• #### 6.  RE: Divide a number by duration field

Posted 05-14-2020 17:31
sorry correction

ToHours([my duration field]) *  .. times whatever your Hourly rate is.

or else

ToDays([my duration field]) *  .. times whatever your Daily rate is.

------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------