Explanation on formula

Hiten Vakharia

Board Regular
Joined
Sep 25, 2013
Messages
66
Hi,
I have come across below forumla, this is for rounding price

Could anyone explain what does this mean
=IF(A3="","",IF(A3<7,CEILING(A3,0.1)-0.01,IF(A3<20,CEILING(A3,0.5)-0.01,CEILING(A3,1)-0.01)))

Thanks
Hiten
 

Some videos you may like

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

bbott

Well-known Member
Joined
Feb 5, 2010
Messages
2,350
That formula is taking your price in A3 and rounding it to end in .99 cents. If it's a whole number, it rounds down (50 becomes 49.99). If it's a decimal, it rounds up (50.15 becomes 50.99).

But if it's less than 7, it's rounding the price to the nearest tenth (5.3 becomes 5.29). If it's less than 20, it rounds to the nearest half dollar (15.3 becomes 15.49).
 
Last edited:

NeonRedSharpie

Well-known Member
Joined
Jul 14, 2014
Messages
1,678
If A3 is blank, blank

If A3 < 7, return .01 less than the next largest dime interval.
eg. 6.45 rounds up to 6.50, then return .01 less, or 6.49.

If A3 between 7 and 20, return .01 less than the next largest half dollar interval
eg. 9.4 rounds up to 9.50, then returns .01 less, or 9.49.
9.8 rounds up to 10.00, then returns .01 less, or 9.49.

If A3 is larger or equal to 20, return .01 less than the next largest full dollar interval
eg. 35.1 rounds up to 36.00, then returns .01 less, or 35.99.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,469
Messages
5,596,309
Members
414,052
Latest member
Dual Showman

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top