How to round up a number to nearest "log multiple" of 1, 2 or 5?

Kelvin Stott

Active Member
Joined
Oct 26, 2010
Messages
338
Hi,

Is the a function or formula I could use to ROUND UP a number to just 1 significant figure, which must be either 1, 2 or 5?

For example:

1.3 -> 2
2.4 -> 5
7.1 -> 10
11 -> 20
21 -> 50
52 -> 100
120 -> 200
219 -> 500
560 -> 1,000

I've tried many combinations of MROUND and ROUNDUP, CEILING, etc., but keep getting tied up in knots.

Thanks for any help.
 
Last edited:

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Hi Aladin, I have seen those links, but unfortunately they don't solve my problem as they aren't restricted to log multipes of 1, 2 and 5. Please check the examples in my original post to see how I need the numbers to round up. Thanks.
 
Upvote 0
So far, this is what I managed to develop:

=CEILING(B4,10^INT(LOG(4*B4))/2)

This rounds the number in B4 up to the nearest log multiple of 1, 1.5, 2, 2.5 and 5, which is not exactly what I was looking for, but actually fits better with what I am trying to do. :-)
 
Upvote 0
I'd be willing to bet there is a simpler formula than this, but until someone posts it, this will have to do...
Code:
[table="width: 500"]
[tr]
	[td]=IF(0+LEFT(A1-0.0000000001)<2,2,IF(0+LEFT(A1-0.0000000001)<5,5,10))*10^(LEN(INT(A1-0.0000000001))-1)[/td]
[/tr]
[/table]
 
Upvote 0
Thanks, Rick, certainly very creative to process a number as text in nested IF-THEN statements, though not exactly elegant! ;-)
 
Upvote 0
Thanks, Rick, certainly very creative to process a number as text in nested IF-THEN statements, though not exactly elegant! ;-)
You did not say you wanted an elegant solution, so I did not give you one.:lol: Besides, I could not think of another way to do it.
 
Upvote 0
This gets me even closer, rounding up to the nearest log multiple of 1, 1.5, 2 and 5, though don't ask me why as I found it by trial and error:

=CEILING(B4,10^INT(LOG(5*B4))/2)
 
Upvote 0
Another possibility: =CHOOSE(LEFT(A2,1)+1,2,2,5,5,5,10,10,10,10)*(10^(LEN((INT(A2))-1)-1))
 
Upvote 0

Forum statistics

Threads
1,223,230
Messages
6,170,883
Members
452,364
Latest member
springate

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
Back
Top