了解数字格式代码(Microsoft Excel)
最常用的格式代码是那些影响整数的代码。 Excel提供了许多功能,如下所示:
Symbol |
Meaning |
|
General |
Uses the general display format. |
|
# |
Indicates a single-digit position. The digit is only displayed if there is a digit in that position. |
|
0 |
Indicates a single-digit position. If there is no digit in the position, a 0 is displayed. |
|
? |
Same as the 0 symbol, except results in a space being displayed for insignificant 0s on either side of the decimal point. |
|
. (period) |
The decimal point. |
|
% |
Percentage. The number is multiplied by 100 (for the display) and the % sign is added. |
|
, (comma) |
Thousands separator (if surrounded by digit place holders) or a thousands scalar (if the comma follows all the place holders). |
|
E- E+ e- e+ |
Displays in scientific format. |
|
$ – + / ( ) : space |
Displays that character |
|
\ |
Forces display of the following character |
|
* |
Repeats the next character to fill out the column width. |
|
_ (underscore) |
Leaves a space the width of the following character. |
|
“text” |
Displays the text within the quotes. |
|
@ |
Text place holder. |
为了更好地理解这些代码的作用,请查看下表中的信息,该信息显示了几种常见格式以及它们如何影响数字。
Category |
Format |
Value |
Displayed As |
|||
Number |
,#0.00 |
.01 |
0.01 |
|||
.1 |
0.10 |
|||||
1234 |
1,234.00 |
|||||
-5678 |
-5,678.00 |
|||||
Percentage |
0.00% |
.01 |
1.00% |
|||
.1 |
10.00% |
|||||
1.234 |
123.40% |
|||||
-5.678 |
-567.80% |
|||||
Scientific |
0.00E+00 |
.01 |
1.00E-02 |
|||
.1 |
1.00E-01 |
|||||
1234 |
1.23E+03 |
|||||
-5678 |
-5.68E+03 |
|||||
Currency |
$,0.00_);[Red]($,0.00) |
.01 |
$0.01 |
|||
.1 |
$0.10 |
|||||
1234 |
$1,234.00 |
|||||
-5678 |
($5,678.00) |
无论使用哪种格式显示数字,数字的实际准确性均不会受到影响。因此,如果一个数字使用两个小数位显示,则它在内部仍保持为15个小数位。
所有计算均使用更准确的内部表示进行。
_ExcelTips_是您进行经济高效的Microsoft Excel培训的来源。
本技巧(1939)适用于Microsoft Excel 97、2000、2002和2003。