Feb 23 2024 02:30 AM
I'm using an 'IF' argument and I want the 'NO' response to provide a quantity rounded up to the next multiple of 10.
I've got as far as "=IF(E5>80,0,"
My E5 quantity is less than 80 and I want the E5 value to be used, rounded up to the next multiple of 10.
Should I use the 'ISO CEILING' function or the 'CEILING.MATH' function to complete the NO argument, and where do I put the brackets?
Feb 23 2024 02:37 AM
Feb 23 2024 02:52 AM
To achieve your desired functionality in the "NO" argument of your IF formula, you can use either the CEILING.MATH or ROUNDUP function, placed within brackets after the comma separator. Here's how:
Using CEILING.MATH:
=IF(E5>80,0,CEILING.MATH(E5,10))
This formula checks if the value in cell E5 is greater than 80. If yes, it returns 0. Otherwise, it applies the CEILING.MATH function, which rounds up the value in E5 to the nearest multiple of 10.
Using ROUNDUP:
=IF(E5>80,0,ROUNDUP(E5,-1))
This formula works similarly, but using the ROUNDUP function. However, since ROUNDUP rounds to the nearest integer by default, we need to specify an argument of -1 to round up to the nearest multiple of 10.
Which function to use?
Both functions accomplish the same goal, but there's a subtle difference:
Choose the function based on your desired behavior:
Remember to adjust the cell references (E5) and your specific condition in the IF statement based on your needs.
Feb 23 2024 07:08 AM
As for the formula style, better is to use spaces and/or multiline to avoid extra errors with formula parts
=IF(E5>80,0,CEILING.MATH(E5,10))
=IF(E5 > 80, 0, CEILING.MATH(E5, 10) )
=IF(
E5 > 80,
0,
CEILING.MATH(E5, 10)
)
Variant of above could be
=10*(E5<=80)*(INT((E5-1)/10)+1)
=10 * (E5 <= 80) * (INT((E5 - 1) / 10) + 1)
=10 *
(E5 <= 80) *
( INT((E5 - 1) / 10) + 1 )
Feb 25 2024 06:47 PM
Feb 25 2024 06:48 PM