IF Formula Help

Justinian

Well-known Member
Joined
Aug 9, 2009
Messages
1,557
Office Version
  1. 365
Platform
  1. Windows
In cell A2 is the number 78.13. I am trying to write a formula that rounds A2 down if the last digits is between 0 and 5 and round up if the last is between 6 and 9. This formulas does round down if the number is less than 5 but it will not round up when the number is 5 or greater.

=IF(AND(RIGHT(A2)<5,RIGHT(A2)>0),ROUNDDOWN(A2,0),ROUNDUP(A2,0))
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
I keep getting -1 when using TYPE so I don't know what's happening.
 
Upvote 0
No, I swear I just hit =TYPE(A2). A2 is formatted as a percentage but either way, the formula works now. I just don't get why -1 is showing.
 
Upvote 0

Forum statistics

Threads
1,221,230
Messages
6,158,667
Members
451,507
Latest member
aexis48d

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