Getting commas and two place cents from my IF statement

BrianHall

New Member
Joined
Nov 6, 2013
Messages
38
I have the following IF statement that is not producing commas or two place cents.

=IF(AND(B88>-100,B88<100),"No Difference",IF(AND(B88>-100000,B88<100000),"Immaterial Difference",IF(AND(B88<-1000000,B88>1000000),B88&"Difference",B88&"Difference")))

This is producing a number like -27651083.8250041 Difference

I need it to produce a number like
-27,651,083.83 Difference

Any help would be greatly appreciated.

Thank you
 
Last edited:

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Change these parts:
Code:
[COLOR=#333333]B88&"Difference"
to
[/COLOR]
Code:
[COLOR=#333333]TEXT(B88,"#,##0.00") & "Difference"[/COLOR]
 
Upvote 0
You have to format the cells, however, don't choose "Number" directly, you have to click "More number formats" and in the number category, check the "Use 1000 Separator" and type 2 in the box for decimal places.
 
Upvote 0
You have to format the cells, however, don't choose "Number" directly, you have to click "More number formats" and in the number category, check the "Use 1000 Separator" and type 2 in the box for decimal places.
That won't work. The issue is his formula returns Text, not numbers. So you need to format the numeric part of the text right in the formula.
You can do that with the TEXT function, like I showed above.
 
Upvote 0
Since the last two results are the same, the only things that need to be checked are the first two conditions which can be shortened with the use of ABS.

Does this work for you?

=IF(ABS(B88)<100,"No Difference",IF(ABS(B88)<100000,"Immaterial Difference",TEXT(B88,"#,###.00")&" Difference"))
 
Upvote 0

Forum statistics

Threads
1,215,372
Messages
6,124,532
Members
449,169
Latest member
mm424

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