Add a formatted number to a text string
I'm looking to formulate a cell that has the following statement:
"Our project this month's is $xxx [over / under] budget."
I have a cell that calculates the $ value of the monthly budget. I want to include that number in the text string I drafted above.
So if I have a cell that has $152,345, then I want to have another cell that states...
"Our project this month is $152,345 under budget."
If in the following month, if the calculated value is -$345,679, then I want the following statement:
"Our project this month is -$345,679 over budget."
Anyone know how to that?
Answers
-
="Our project this month is " + [Cell with dollar value] + " under budget."
works in my region.
dm
-
This does capture the number, but the currency formatting is lost. This is what it looks like...
"Our project this month is 152345 under budget."
Rather than...
"Our project this month is $152,345 under budget"
I'm guessing that the formula recognizes only the digits in the source cell and not the overlaying formatting (the $ sign and the comma).
I wonder whether formatting in a different way the number in the source cell might help so that the reference [Cell with dollar value] will also pull the $ sigh and comma separator.
Or...
maybe I can include some formatting in pull reference? Rather than just...
"+ [Cell with dollar value] +"
I can have some character formatting included so that even though the reference merely pulls the digits from the source, it will "reapply" the currency formatting?
Am I over-thinking?
-
See below example, works up till 999,999,999.99
="Our project this month is $" + IF(Amount@row > 1000000, INT(Amount@row / 1000000) + "," + RIGHT(INT(Amount@row / 1000), 3) + "," + RIGHT(INT(Amount@row), 3), IF(Amount@row > 1000, INT(Amount@row / 1000) + "," + RIGHT(INT(Amount@row), 3), INT(Amount@row))) + IF(ROUNDDOWN(MOD(Amount@row, 1), 2) < 0.0001, ".00", IF(ROUNDDOWN(MOD(Amount@row, 1), 2) < 0.09999, ".0" + RIGHT(ROUNDDOWN(MOD(Amount@row, 1), 2), 1), IF(LEN(ROUNDDOWN(MOD(Amount@row, 1), 2)) = 3, RIGHT(ROUNDDOWN(MOD(Amount@row, 1), 2), 2) + "0", RIGHT(ROUNDDOWN(MOD(Amount@row, 1), 2), 3)))) + " over budget"
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.8K Get Help
- 434 Global Discussions
- 138 Industry Talk
- 470 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 65 Community Job Board
- 486 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!