Formatting a formula

beckys

Board Regular
Joined
Apr 19, 2005
Messages
116
Hello,
I have the following formula:

IF(ROUND(J98,2)=ROUND(SUMIF('Sheet2'!$A$8:$A$1000,C97,'Sheet2'!$D$8:$D$1000),2), "OK", "Off By "&J98-SUMIF('Sheet2'!$A$8:$A$1000,C97,'Sheet2'!$D$8:$D$1000))


When the result is false, the text that gets entered in the cell goes out to many decimal points, i.e. "off by 0.0246271358543424". Do you know how to format this so that the text would read "off by 0.02"?

Thanks!!
Becky
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Like this?
Code:
=IF(ROUND(J98,2)=ROUND(SUMIF(Sheet2!$A$8:$A$1000,C97,Sheet2!$D$8:$D$1000),2), "OK", "Off By "& format(J98-SUMIF(Sheet2!$A$8:$A$1000,C97,Sheet2!$D$8:$D$1000),"0.00"))
 
Upvote 0
Like this?
=IF(ROUND(J98,2)=ROUND(SUMIF(Sheet2!$A$8:$A$1000,C97,Sheet2!$D$8:$D$1000),2), "OK", "Off By "& format(J98-SUMIF(Sheet2!$A$8:$A$1000,C97,Sheet2!$D$8:$D$1000),"0.00"))
Never heard of the "format" function.

I'll be you meant to use TEXT(...).

=IF(ROUND(J98,2)=ROUND(SUMIF(Sheet2!$A$8:$A$1000,C97,Sheet2!$D$8:$D$1000),2),"OK","Off By "&TEXT(J98-SUMIF(Sheet2!$A$8:$A$1000,C97,Sheet2!$D$8:$D$1000),"0.00"))
 
Upvote 0
lol. yeah, I meant "TEXT". I'm so used to VB now... I barely know excel itself anymore.
 
Upvote 0

Forum statistics

Threads
1,215,034
Messages
6,122,782
Members
449,095
Latest member
m_smith_solihull

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