Find dollars and cents

chaddres

Board Regular
Joined
Jun 14, 2014
Messages
140
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

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
Joined
May 17, 2009
Messages
5,745
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
chaddres,

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

Hope that helps.
 
Upvote 0

Rick Rothstein

MrExcel MVP
Joined
Apr 18, 2011
Messages
38,154
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
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,195,905
Messages
6,012,218
Members
441,682
Latest member
gad3lha

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
Top