Format Number Within Text String

jski21

Board Regular
Joined
Jan 2, 2019
Messages
155
Office Version
  1. 2016
Platform
  1. Windows
Good morning Mr. Excel Team,

Trying to format a number within a text string using what I believe to be the correct number format. Here's the formula (number format in red):

=TEXT(ROUND(B11,0)-ROUND(B30,0),IF(B11,"#,##0;(#,##0)","0")&""&IF(B11>B30,"▲",IF(B11=B30,"●","▼")))

I need the negative numbers formatted in parentheses using a 1000 separator. (I'd prefer the negatives to be in parentheses and red, but let me get this step out of the way first). Here's an Xl2bb snapshot:

Operating-Budget-Template.xlsx
AB
11Total General Administration-
12
13Less Salaries:
14Salary Cost 1250,000
15Salary Cost 2250,000
16Salary Cost 3250,000
17Salary Cost 4250,000
18Salary Cost 5250,000
19Salary Cost 6250,000
20Salary Cost 7250,000
21Salary Cost 8250,000
22Salary Cost 9250,000
23Salary Cost 10250,000
24Salary Cost 11250,000
25Salary Cost 12250,000
26Salary Cost 13250,000
27Salary Cost 14250,000
28Salary Cost 15250,000
29
30Total Salary Costs3,750,000
31Salary Cap Margin-3750000▼
Operating Budget Template
Cell Formulas
RangeFormula
B11B11=SUM(B7:B9)
B30B30=SUM(B14:B28)
B31B31=TEXT(ROUND(B11,0)-ROUND(B30,0),IF(B11,"#,##0;(#,##0)","0")&""&IF(B11>B30,"▲",IF(B11=B30,"●","▼")))


Cell in question is B31 and is currently displaying as -3750000▼. Huh?


Thanks in advance for the early morning (here) assistance.


jski
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Cell in question is B31 and is currently displaying as -3750000▼. Huh?

Hi, it's because you only apply that format pattern if B11 is not zero. as it is zero you are using the "0" format pattern.

=TEXT(ROUND(B11,0)-ROUND(B30,0),IF(B11,"#,##0;(#,##0)","0")&""&IF(B11>B30,"▲",IF(B11=B30,"●","▼")))
 
Upvote 0
Solution
Too early in the morning

Happens to the best of us :)

FWIW - I think your formula can be simplified a bit to.

Excel Formula:
=TEXT(ROUND(B11,0)-ROUND(B30,0),IF(B11,"#,##0▲;(#,##0)▼;0●","0"))
 
Upvote 0
I do like this simpler format. Thanks for the instruction!
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,325
Members
452,635
Latest member
laura12345

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