Find dollars and cents

chaddres

Board Regular
Joined
Jun 14, 2014
Messages
143
Office Version
  1. 365
Platform
  1. Windows
I want to create a formula that takes cell F7 and divides it by 3. If the result is a decimal with two places, I want that number. If it is a decimal with more than 2 places, I want to print "error".

Example: F7 = 244.50. 244.50/3 is 81.50. I want to print 81.50
Example: F7 = 81.50. 81.50/3 is 20.375. I want to print "error"

I tried this:

F8 = F7/3
IF(ROUND(F8, 2) = F8, F8, "error")

This did not work.
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
chaddres,

Maybe... =IF(F7/3=ROUND(F7/3,2),F7/3,"Error")

Hope that helps.
 
Upvote 0
Why didn't it work?
Who is your question directed at? If me, it is probably because I used cell A1 instead of F7 like you showed in your original message. Here is the formula using that cell directly...

=IF(MOD(100*F7,3),"Error","")


Edit Note: I just noticed you are not the OP for this thread. Explain what you did, what value was in the cell, what you expected to happen.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,593
Messages
6,120,435
Members
448,961
Latest member
nzskater

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