If Statement for Number Formatting

dms04d

New Member
Joined
Jan 9, 2013
Messages
12
For a cell that will display a percentage followed by a number associated with the percentage, I have the below formula. The issue I have with the formula has to due with the number formatting, which will display a number less than 1,000,000 with a "k" (e.g. 150k) and greater than 1,000,000 with an "m" (e.g. 15m). The formatting formula works fine with the "k" less than 1,000,000 numbers, but it shows "#VALUE!" error with numbers in the millions. Suggestions?

=IF(V48<0.005,"",TEXT(V48,"0%")&CHAR(10)&TEXT(V42,IF(V42<1000000,(("$#,##,")&"k"),(("$#,##0.00,,")&"m"))))
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
I removed the last element of the formula &"m" and it worked properly... I just need to somehow get the letter m back into the formula
 
Upvote 0
Even stranger... the original formula works if you simply replace the letter M with any other letter! o_O
 
Upvote 0
YES!!!!! Thank you so much!! ?
you are welcom :giggle: there are several letters have specific meanings in the format code, for example, m stands for Month, =TEXT(TODAY(),"e-m-d") will return "2020-5-19", =TEXT(TODAY(),"e-\m-d") returns "2020-m-19". so if you want to use the letter m just as a common letter, you should add \ before the letter to eliminate the specifict meanning of Month.
 
Upvote 0

Forum statistics

Threads
1,215,012
Messages
6,122,682
Members
449,091
Latest member
peppernaut

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