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

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
You could also use

=IF(AND(B45<0,B45< E45+F45),"BUY "&TEXT(ABS($B45-E45+$F45),"#,###"),0)
 
Upvote 0
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),"")
 
Upvote 0

Forum statistics

Threads
1,217,763
Messages
6,138,459
Members
450,139
Latest member
myexcel202424

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