Feb 15, 2018 10:33 AM
I cannot seem to get a simple division of two fields to work. What am I missing? My goal is to find the percent utilized. January hours scheduled divided by the total number of work hours in Jan. Both of these fields are themselves a calculated value, not sure if that matters.
My formula looks like:
JanuaryTotalHoursBooked/JanMonthlyAvailHours
The formatting tab is set to percentage. (returns error with integer too)
It returns #errror!
Thanks
Feb 15, 2018 11:26 AM
Perhaps it has something to do with the format of the two fields you are dividing - what format are those calculated fields?
Feb 16, 2018 10:43 AM
The two fields are both formula fields - integer formatting. So the values are like 120/176. And really it should be (120/176)*100 = percentage
Can division be done on formula fields? How might I work around that if that’s the case?
Thanks!
Feb 16, 2018 11:50 AM
There shouldn’t be a problem with those fields, Double-check you’re pulling the fields you think you are, that they are indeed integers, and you have no duplicate names. And {JanMonthlyAvailHours}
isn’t 0, it?
Feb 16, 2018 12:18 PM
They are not duplicated names.
The avail hours is not 0. This is the formula in that column - IF({WeeklyHours} =40, “176”, “120”) If weekly hours are equal to 40, then 176. Else 120. Is what I was going for. It does populate the right values.
This might be where the issue is. The other field is an integer, but this one (JanMonthlyAvailHours) gives me this message on the Formula Formatting tab “Your result type is not a number or a date. Formatting options are currently only available if your result is a number or a date.”
176 and 120 are integers, but maybe I do not have the right syntax?
Thanks for your help! I just started looking at AirTable this week for a specific need we have. I’m nearly there to say Yes! This tool can work.
Feb 16, 2018 05:28 PM
IF({WeeklyHours} =40, "176", "120")
does not give you an integer; it gives you a string.
You want
IF({WeeklyHours} =40, 176, 120)
That should allow your division to happen error-free.
Feb 19, 2018 10:07 AM
Yes! That fixed the problem! Thank you!!
Jan 06, 2020 07:37 AM
Hi, my formula is this= {Time in seconds}/3600 and it still returns as error. What am I doing incorrectly?
Jan 06, 2020 01:47 PM
@Norlin_Sunga can you post your full formula. There’s nothing wrong with the snippet you posted, so the error you are getting is likely from the surrounding context of the snippet you posted.
Jan 06, 2020 02:11 PM
I actually found a workaround. It is because the dividend is a string and not an integer. Thank you!