Format numbers as text in Excel for Mac

Applies To
Excel for Microsoft 365 for Mac Excel 2024 for Mac Excel 2021 for Mac

If you want Excel to treat numbers as text, apply the Text format to the cells before entering the data. This is useful for values such as credit card numbers, account numbers, or other identifiers that aren't used in calculations. Excel stores only 15 digits of precision for numeric values, so longer numbers can be changed automatically unless they are stored as text.

You can tell whether a value is stored as text because it is left-aligned in the cell by default, while numbers are typically right-aligned.

  1. Select the cell or range of cells that contains the values you want to format as text.

    Tip

    To cancel a selection, click any cell on the worksheet. You can also format empty cells as text before entering data. Any numbers entered afterward will be stored as text.

  2. On the Home tab, select the arrow in the Number Format box.

  3. Select Text.

    Screenshot that shows where to select format numbers as text.

Tip

  • 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 deletes 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 changes 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.
  • 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.
  • You can also use the TEXT function to convert a number to text using a specific number format.