# Round numbers based on last digit

#### nchiari

##### New Member
Hi again guys! Thanks to you I'm optimizing a lot my worksheet! I have another question to ask you.

AQ2: =(AO2-AP2). That ecuation gives me a result that I need to round with the next criteria:

• If the result ends with the digits: 2, 3, 4, round it to end with 5 (ie. 102, 103, 104, round to 105)
• If the result ends with the digits: 7, 8, 9, round it to end with the next 0 (ie. 107, 108, 109, round to 110)
• If the result ends with the digit: 1, round it to end with the previous 0 (ie. 101, round to 100)
• If the result ends with the digit: 6, round it to end with the previous 5 (ie. 106, round to 105)

I googled it a bit and found this formula, but I don't know how to change it to work for my case:

=AQ2+CHOOSE(MOD(AQ2;10)+1;-1;-2;-3;1;0;0;3;2;1;0)

Thanks again!!

### Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
PS: remember that I also need that the same cell with the round formula first have a (XX-XX) formula to obtain the number who's gonna be rounded.

Try

=CEILING((XX-XX)-1,5)

Wow! Work like charm! Thank you very very much!!

Hi.

=MROUND((XX-XX)+1,5)

Regards

Lol thanks guys! If I knew about this forum before, my work day would have been a lot easier

Replies
7
Views
375
Replies
3
Views
153
Replies
4
Views
280
Replies
9
Views
3K
Replies
2
Views
102

1,203,483
Messages
6,055,672
Members
444,806
Latest member
tofanexcel

### 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?

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