To keep codes such as 00123 intact, import the CSV through Excel for Mac’s data import tools and set the identifier column to Text before loading. Simply opening a CSV can let Excel interpret digit strings as numbers, removing zeros; formatting cells after that has happened does not restore the original value. For a repeatable import, use Power Query when it is available, check the preview, and confirm the loaded code column still matches the file.

Why Excel removes leading zeros

Excel generally treats digit-only values as numbers so they can be used in calculations. Leading zeros have no numeric value, so a code such as 00123 may become 123. But identifiers—postal codes, product IDs, account codes, and similar fields—are labels, not quantities. Their digits and formatting are part of the value. Microsoft recommends storing such values as text to preserve their original form. Keeping leading zeros and large numbers

This distinction matters beyond the first zero. Excel stores only 15 digits of numeric precision, so a long identifier can also lose digits if it is treated as a number. Decide which columns are identifiers before import; those should generally be text, while columns intended for arithmetic can remain numeric.

Import the CSV with Power Query on a Mac

The Power Query interface varies with Excel version and subscription. Microsoft documents Power Query for Microsoft 365 for Mac, and says the Power Query Editor is generally available to subscribers using Excel for Mac version 16.69 or later. If you do not see the controls described below, use the legacy import method in the next section if it is available. Import and shape data in Excel for Mac (Power Query)

  1. Open Excel and choose Data > Get Data. Select Text/CSV as the data source. Depending on your ribbon layout, the route may appear as Data > Get Data (Power Query), followed by a source chooser.

  2. Find the CSV in the file picker and open it. Excel displays an import preview. Check that the delimiter separates fields into the columns you expect, and that the first row is handled correctly as headers if your file has column names. Power Query can detect column types automatically, so do not assume that a code column is already text.

  3. Choose Transform Data or Edit to open the query editor. Click the header of the column containing codes that must retain zeros. In the editor, choose Home > Transform > Data Type > Text. If Excel asks whether to replace the existing type change, choose Replace Current so the column is text before loading.

  4. Review the preview for representative values. A value that should read 00123 must appear with both zeros. If the column contains mixed formats or the preview shows an unexpected split, fix the delimiter or type choice before continuing.

  5. Choose Home > Close & Load (or the available Load control) to place the imported data in a worksheet. Check the resulting column, including a few of the longest codes and codes with leading zeros. Excel for Mac places imported results in a new sheet in the documented Power Query workflow. Import and shape data in Excel for Mac (Power Query)

The important step is setting the type in the import transformation, not merely changing the worksheet’s display format. The import preview lets you catch an unwanted type conversion before loading. If you later refresh the query, Excel applies its saved transformation steps to the refreshed data. That is useful for recurring CSVs, provided the source file continues to have a compatible structure. Keeping leading zeros and large numbers

If Power Query is unavailable: use Text Import Wizard

Some Mac versions expose the older wizard as Data > From Text (Legacy). Microsoft’s Mac instructions describe opening the CSV from that command and using the wizard’s preview to choose the file type, delimiter, and per-column format. On the wizard’s final page, select the identifier column and set its column format to Text, then finish the import and choose where to place the data. Import and shape data in Excel for Mac (Power Query)

For a comma-separated file, select Delimited and use the comma delimiter. Keep the text qualifier set to the character used by the file—commonly a double quote—so a comma inside a quoted field stays within that field rather than creating a false extra column. Check the wizard’s preview before finishing; the delimiter and text qualifier affect how the rows are split. Text Import Wizard

If From Text (Legacy) is missing, the feature may not be enabled or available in that Excel build. Microsoft documents the legacy wizard as a backward-compatibility feature and notes that availability and setup differ by Excel environment. Do not rely on Windows-only menu paths when looking for the setting on a Mac. Use the Power Query import route if your Mac version provides it, or consult the Excel for Mac instructions for the version you have. Text Import Wizard

Check whether the zeros are gone or only hidden

After import, inspect the cell’s value in the formula bar and compare it with the original CSV value. If the worksheet displays 123 but the underlying value is the text 00123, the issue may be display formatting. If the formula bar itself shows 123, Excel has already discarded the zeros in the imported value. Formatting the cell as Text after import cannot reconstruct how many zeros were present; you need to reimport from the original CSV and assign the column the Text type during import. Microsoft similarly warns that applying a custom number format does not restore zeros removed before the format was applied. Keeping leading zeros and large numbers

A custom number format such as 00000 can display a fixed-width numeric code with leading zeros, but it is a presentation format inside that workbook. Microsoft distinguishes this from storing the value as text and limits this approach to codes under 16 digits. If another program will read the exported data, a displayed zero is not a substitute for preserving the identifier as text in the imported data. Keeping leading zeros and large numbers

A quick import decision

  • Codes, phone numbers, postal codes, or account IDs: import the column as Text so the characters remain intact; these are not quantities for arithmetic.

  • Amounts or counts used in formulas: use a numeric type where appropriate, and verify decimal and date interpretation in the preview.

  • Long digit strings: use Text even if they have no leading zero, because Excel’s numeric precision is limited to 15 digits. Format numbers as text in Excel for Mac

  • Repeated imports: save the workbook’s query and refresh it when the source file changes, then spot-check the identifier column after refresh. If the file’s columns or delimiter change, review the preview and transformation rather than assuming the old query still matches.

When you are working through an import alongside other open Mac windows and task lists, Wallo can organize existing windows and to-dos locally by goal, with keyboard focusing. It does not perform the CSV import or alter Excel’s data types.

Sources