Find dollars and cents

Board Regular
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

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

Snakehips

Well-known Member

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

Hope that helps.

Rick Rothstein

MrExcel MVP
I think this would work...

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

steve the fish

Well-known Member
Why didn't it work?

Rick Rothstein

MrExcel MVP
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:

Replies
1
Views
479
Replies
0
Views
497
Replies
2
Views
149
Replies
3
Views
131
Replies
1
Views
249

1,195,905
Messages
6,012,218
Members
441,682
Latest member

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.

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

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