Formatting a number within concatenation

aaronmberg

New Member
Joined
Feb 2, 2006
Messages
10
Here is part of an If statement that I am using.

=IF(AND(B45<0,B45<(E45+F45)),"BUY"&" "&ROUND(ABS($B45-(E45+$F45)),0)

If this is true and it returns "BUY ####", how can I format the number to have a comma separating thousands (#,###)?

Thanks in advance!
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.

barry houdini

MrExcel MVP
Joined
Mar 23, 2005
Messages
20,825
Try something like

=IF(AND(B45<0,B45< E45+F45),"BUY "&FIXED(ABS($B45-E45-$F45),0),0)
 

Artemus

Board Regular
Joined
Dec 30, 2004
Messages
92
You could also use

=IF(AND(B45<0,B45< E45+F45),"BUY "&TEXT(ABS($B45-E45+$F45),"#,###"),0)
 

barry houdini

MrExcel MVP
Joined
Mar 23, 2005
Messages
20,825
Given your conditions $B45-E45-$F45 will always be negative when the IF condition is true so you don't really need ABS, you could use

=IF(AND(B45<0,B45< E45+F45),"BUY "&FIXED(E45+$F45-$B45,0),"")
 

Forum statistics

Threads
1,137,333
Messages
5,680,881
Members
419,937
Latest member
Talic

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