问题
Here is what I want to accomplish:
Value Display
1 1
11 11
111 111
1111 1.11k
11111 11.11k
111111 111.11k
1111111 1.11M
11111111 11.11M
111111111 111.11M
1111111111 1.11B
11111111111 11.11B
111111111111 111.11B
This is the format that a Bloomberg terminal uses to display currency figures. Numbers don't go past B
.
Here is what I have tried so far:
[>999999999.999]#,,,"B";[>999999.999]#,,"M";#,##0_M
I stole it from here and I cannot find documentation that shows how to improve it.
回答1:
When using conditions in a custom number format, you can have a maximum of two conditions with one default number format and one default text format.
[>=1000000000]#0.0#,,, \B;[>=1000000]#0.0#,, \M;#0.0#, K
To attain your fourth criteria, you need something that will override the custom number format. A Conditional Formatting Rule seems appropriate here. Create one based on the following formula,
=$b2<10^3
Click Format then the Number tab and set the custom number format for 0_)
.
Of course, that CFR number format potentially could be two more conditions and a default but you only require a single additional number format.
来源:https://stackoverflow.com/questions/44317794/excel-number-format-for-abbreviation