Monday, March 6, 2017

Format numbers as text

Format numbers as text

If you want Excel to treat certain types of numbers as text, you can use the text format instead of a number format. For example, for credit card numbers, or other number codes that have 16 digits or more, you'd use a text format.

Tip:  Numbers formatted as text, are left-aligned in the cell.

  1. Choose the cell or cell range that has the numbers you want to format.

  2. Click Home the arrow next to the Number box and click Text.

Note: If you don't see Text, scroll to the end of the list.

Tips

  • To use decimal places in numbers that are stored as text, you may need to include the decimal points when you type the numbers.

  • When you enter a number that begins with a zero—for example, a product code—Excel will delete the zero by default. If this is not what you want, you can create a custom number format that forces Excel to retain the leading zero. For example, if you're typing or pasting ten-digit product codes in a worksheet, Excel will change numbers like 0784367998 to 784367998. In this case, you could create a custom number format consisting of the code 0000000000, which forces Excel to display all ten digits of the product code, including the leading zero. For more information about this issue, see Create or delete a custom number format and Keep leading zeros.

  • Occasionally, numbers might be formatted and stored in cells as text, which later can cause problems with calculations or produce confusing sort orders. This sometimes happens when you import or copy numbers from a database or other data source. In this scenario, you must convert the numbers stored as text back to numbers. For more information, see Convert numbers stored as text to numbers.

  • You can also use the Text function to change a number to text in a specific number format. For examples of this technique, see Keep leading zeros. For information about using the Text function, see Text function.

No comments:

Post a Comment