🧪 12 Formulas to get you started with the new Advanced Editor

Hi @Rebekah_Chalkley , here’s a table in the Help article

But if you can upload a screenshot shot here, I’ll be happy to try and help you out!

Also check the errors and limits section here (scroll down a bit).

1 Like

@Richard_Sather I wanted to have a number of days in a field based on the actual time. So I did “time / 7” but it gave me a number of hours, so I did “time /7+0” to remove the unit. Do you want to document it? (or maybe it was and I missed it)

Hey @Bastien_Siebman , it might help if you always start your formula by converting the time field to minutes, as so: (Actual time+0)
That should convert 1 hour into 60 minutes. So to convert that back into hours, we need to divide by 60. And since you want it in number of days, assuming 7 hours in a work day, then divide by 7 again.

So you should end up with:
(Actual time+0) / 60 / 7

Or for ease, copy & paste this into your advanced formula editor:
( [[$ACTUAL_TIME]] + 0 ) / 60 / 7

PS: I added it in number 1, formula 4 :wink:

1 Like

Damn, you are good :heart:

1 Like

Hey @Richard_Sather

It looks like you have become the ‘formula’ expert on the forum! Wondering if you or someone else here can explain one strange phenomenon? In the screenshot you’ll see a ‘First Draft Date’ custom field to the left of Asana’s ‘Completed on’ native field. The ‘First Draft Date’ was generated via a Rule: ‘When dependency is unblocked > set for ‘Day this Rule is triggered’.

What’s odd is the ‘Days to Complete’ calculation which subtracts ‘First Draft Date’ from ‘Completed on’. You will see it is set for 18 hours, even though the time between when the ‘First Draft Date’ was completed and when the task was completed was minutes. I thought maybe it was calculating from 12am for the First Draft Date since it might not grab the time when populating that field - but that still doesn’t make sense as that would be 13h 13m. Eighteen hours actually rolls all the way back to the previous day by about 5 hours.

Any thoughts?

Hi @Wayne_Hedlund1 , yes this is unfortunately expected behaviour and obviously odd when I assume you would like the result to be a zero, in your case, if your ‘First draft date’ and ‘Completed on’ are the same day.

To overcome this, we need to compensate for the discrepancy. A Date field or Due date field will end at UTC and I think it depends on your time-zone when the completed on time is ‘set’. Either way, it doesn’t matter because we can figure out the difference and compensate for that by building it into our formula.

First, we will need to convert your ‘Days to complete’ formula into a number format. Unfortunately, you cannot change the number formatting after you have created a formula using any Date inputs (the formatting tab gets locked / greyed out for some reason).

So you will need to create a new formula field from scratch. Enable the Advanced editor to create a formula like this:


In your case, replace the Due date field with your First Draft date field.
Do NOT Create the field yet!
Go to the Formatting tab and select the Number format with a couple of decimals, like this:

Now click Create field.

Check the value that you got. For example, I happened to get -0.77 (because it’s in the evening where I am). So I will go back to my formula and compensate this difference by adding that value as a positive so the result is a zero, like this:

You can then change your formatting to a custom label by adding a ‘d’ and you could also remove the decimals if you want so it will round up to the closest day:


Save changes and you should be good to go! :wink:

PS: I got ‘-0d’ actually, so I went back and compensated further by changing my 0.77 difference to 0.78 so it rounds up to a positive 0 value. (because I removed the decimals).

3 Likes

@Richard_Sather

Like I said, you’re definitely the SME on all things formulas! Great job. That worked perfectly. Thanks so much!

1 Like

Ha! Glad to help, @Wayne_Hedlund1 :slight_smile:

Is there a formula I can use to only calculate the difference between the date completed and start date in business days? I want to exclude weekends