Excel number format for abbreviation

↘锁芯ラ 提交于 2019-12-10 22:08:56

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!