by Allen Wyatt
(last updated August 27, 2016)
The most frequently used formatting codes are those that affect straight numbers. Excel provides many of them, as shown here:
|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.|
To understand better what these codes do, take a look at the information in the following table, which shows several common formats and how they affect numbers.
No matter which format is used to display numbers, the actual accuracy of the number is not affected. Thus, if a number is displayed using two decimal places, it is still maintained internally to 15 decimal places. All calculations are performed using the more accurate internal representation.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (1939) applies to Microsoft Excel 97, 2000, 2002, and 2003.
Save Time and Supercharge Excel! Automate virtually any routine task and save yourself hours, days, maybe even weeks. Then, learn how to make Excel do things you thought were simply impossible! Mastering advanced Excel macros has never been easier. Check out Excel 2010 VBA and Macros today!
If you have a range of numeric values in your worksheet, you may want to change them from numbers to text values. Here's ...Discover More
Want information in a worksheet to be formatted and displayed as rounded to a power of ten? You may be out of luck, ...Discover More
What are you to do if you are trying to format a worksheet, only to find out that one of the tools you need is not ...Discover More
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.