Help

The integer part of a division

2237 2
cancel
Showing results for 
Search instead for 
Did you mean: 
Vincent_Pelleti
5 - Automation Enthusiast
5 - Automation Enthusiast

Hi,

i can’t get the integer part of the result of a division.

The aim is to transform for exemple 5400 (a number representing seconds) in that string: “1h 30mn”.
To get the hours, i divide 5400 by 3600. The result is 1.5.
Using the ROUND function does not work: i get “2” when i want “1”.
Same thing with the number formating options.

It may be obvious but i can’t find a way!

2 Replies 2
Matt_Bush
Airtable Employee
Airtable Employee

To round down to the nearest integer (also known as a Floor function), you can subtract 0.5 from the number and use the Round function. For example, ROUND(NumMinutes - 0.5). This will give you the result 1 for the value 1.5.

Hi, thanks for the reply.

It work if i know beforehand the value of the division, but it was an exemple.
My question was more abstract: I have that formula seconds / 3600, how to get the nearest integer from the result?

Finally, i have resolved my problem. Here it is for anyone who could need it:
IF((MOD(seconds, 3600) / 3600) >= 0.5, ROUND(seconds / 3600) - 1,ROUND(seconds / 3600))

Is there a simpler solution?