Rounding Numbers

This seemed like a tricky one so I wanted to give it a shot. There may be better ways of doing this, but it’s what I’ve come up with so far.

In a table where one column is the value entered, [Value], and the other is the result of the rounding, [Result], and both are formatted to “Number”, add this equation to the [Result] column:

If(Round(thisRow.Value - RoundDown(thisRow.Value,0),1) >= 0.7,RoundDown(thisRow.Value,0) + 1,If(Round(thisRow.Value - RoundDown(thisRow.Value,0),1) >= 0.2,RoundDown(thisRow.Value,0) + 0.5,If(Round(thisRow.Value - RoundDown(thisRow.Value,0),1) >= 0.0,RoundDown(thisRow.Value,0),"Missing Value")))

I went off what you posted here, but you can change your bounds if you need to.

This equation is taking the entered Value and then subtracting the same value using RoundDown(). It’s also using Round() to limit this to one decimal place. This leaves us with just the decimal to work with.

Then it uses the IF() statements to see what range the decimal falls into.

Lastly, it takes the RoundDown() number and adds the proper decimal value to it based on the range, so 0, 0.5, or 1.

1 Like