To import a CSV file with its first row as column headings in Excel for Microsoft 365 on Windows, select Data > From Text/CSV, choose the file, check the preview, and select Load. If Excel has not recognized the headings, choose Transform Data, then in Power Query select Home > Use First Row as Headers before loading.
What CSV headers mean in Excel
A CSV, or comma-separated values file, is plain text that stores records in rows and separates fields with a delimiter, commonly a comma. The first row often contains labels such as Customer, OrderDate, and Amount. Those labels are the headers: they tell you what each column contains, but they are not special formatting or metadata in the CSV itself. Excel must interpret that first row as column names when you import the data.
For example, a simple file might begin with Customer,OrderDate,Amount, followed by Lee,2026-04-12,58.40. With the first row treated as headers, Customer is the name of the first column and Lee is its first data value. If Excel instead treats every row as data, the labels appear in row 1 and may be included in sorts, calculations, or reports as though they were a record.
Importing through Excel’s data tools is useful because it gives you a preview and a chance to control how the text is interpreted. That matters when a CSV contains dates, long numbers, identifiers with leading zeroes, or a delimiter other than a comma.
Import a CSV using the Data tab
- Open the workbook where you want the imported data, or create a blank workbook. Select Data > From Text/CSV.
- Browse to the CSV file, select it, and choose Import. Excel displays a preview of the file.
- Check the preview’s delimiter and confirm that the columns line up as expected. If the first row contains labels, verify that Excel has recognized them as headers; if it has not, choose Transform Data.
- In the Power Query Editor, select Home > Use First Row as Headers. Confirm that the column headings now show the labels from the file rather than generic names such as Column1.
- Select Home > Close & Load to place the result in a worksheet. If you need to choose a destination or load as a connection, use the available load options instead of loading directly.
The preview and editor let you catch problems before the imported data lands in the workbook. If the data is already arranged correctly in the preview, you may be able to select Load without opening the editor. The exact controls in the preview can vary with the file and Excel build, so use the editor when you need to make a definite header or data-type adjustment.
Promote the first row when headers were missed
Sometimes Excel displays the first record as data, even though it contains headings. This can happen when automatic detection does not identify the header row, or when the file begins with extra lines such as a report title or blank rows. In the Power Query Editor, Home > Use First Row as Headers promotes the current first row. It does not search farther down the file for a row that looks like headings.
If the real headings are on row 3, first remove the title and blank rows above them. In Power Query, use Home > Remove Rows to remove the rows before the header row, then promote the remaining first row. Check the result before loading: a correct header row should have one meaningful label per column, with the actual records beginning beneath it.
To undo a promotion in Power Query, use the applied steps list to remove the step that promoted headers, or use the corresponding command if available. Avoid promoting a data row by mistake. Once loaded, column names are used in table references and reports, so an incorrect header can affect later work even if the visible sheet looks plausible.
Check the delimiter and file encoding
A comma is common, but CSV files can use semicolons, tabs, or other separators. The delimiter setting determines where Excel splits each record into columns. If the preview shows each line in one wide column, or splits values in the wrong places, choose the appropriate delimiter in the import preview or adjust it in Power Query. Do not split on a comma just because the file extension says CSV; inspect the actual preview.
Quoted fields can contain delimiters without starting a new column. For example, a field such as "Portland, Oregon" is meant to remain together as one value when the file follows standard CSV quoting rules. If the preview breaks that value into two columns, check the delimiter and text-qualifier settings rather than editing every row manually.
Encoding affects how characters such as accented letters and symbols appear. If names or punctuation display incorrectly, reopen the import and check the file-origin or encoding choice in the preview. UTF-8 is a common encoding for modern CSV files, but the right choice depends on how the file was created. A file that looks correct in a text editor can still display incorrectly if Excel reads it using a different encoding.
Protect dates, numbers, and leading zeroes
Excel may infer data types as it imports. That is convenient for ordinary dates and amounts, but it can change values that are identifiers rather than quantities. A product code such as 004281 may become 4281 if interpreted as a number. A long account or tracking number may be converted to scientific notation or lose precision when treated as a numeric value.
For identifiers, postal codes, telephone numbers, and other values whose exact characters matter, set the column’s type to text in Power Query before loading. Select the column and use the data type control to choose Text. If preserving leading zeroes is important, confirm the loaded result rather than assuming that a number format alone will restore them: once the zeroes are discarded, formatting the cell cannot recover the original text.
Dates deserve a similar check. A value such as 03/04/2026 can mean March 4 or April 3 depending on the date convention used by the source. If Excel assigns the wrong date, verify the source’s convention and the locale used to interpret the column. In Power Query, a date type can be changed using the appropriate locale option where needed. For ambiguous data, keeping the original column as text until the intended interpretation is clear is safer than guessing.
Choose between loading and transforming
Use Load when the preview is already correct and you simply want the records in a worksheet. Choose Transform Data when you need to promote headers, remove unwanted rows, select columns, change data types, or correct the delimiter before loading. Power Query records these changes as steps, so a repeat import can apply the same preparation again when the source is updated.
For a one-time file, loading to a worksheet is usually the most straightforward choice. For recurring files with the same layout, a query can make the process more consistent: update or replace the source file and refresh the query rather than repeating every cleanup action. If you load a query as a connection only or to the Data Model, the data may not appear as a visible worksheet table, so choose that only when it suits the workbook’s purpose.
After loading, you can format the result as an Excel table using Home > Format as Table if you want filter buttons and structured references. This is separate from recognizing CSV headers: the import establishes column names, while an Excel table adds workbook features around the loaded range.
Importing versus opening a CSV directly
You can also open a CSV by using File > Open or by opening it from your file browser. Excel will generally place the file’s contents into a worksheet, with the first line appearing in row 1. This is quick for a simple file, but it gives you less opportunity to review parsing choices before data is interpreted. A direct open can also make it easier to overlook automatic conversions, such as losing leading zeroes.
Use Data > From Text/CSV when accurate types, delimiter control, repeatable cleanup, or a clear preview matters. Use direct opening for a disposable, uncomplicated file when you have checked the result. A CSV does not preserve Excel features such as formulas, cell formatting, multiple worksheets, or column widths. If you need to keep those features, save the finished workbook as an Excel workbook, such as an .xlsx file, rather than saving it back as CSV.
On Excel for Mac, Power Query import availability and labels can depend on the Microsoft 365 build. Where available, use the Data tab’s Get Data or Power Query options to import text or CSV and inspect the query in the editor; the Windows instructions above describe the Windows ribbon. Excel for the web has a different feature set and may not expose the same desktop import controls. If a particular import option is missing, use desktop Excel for the Power Query workflow.
Refresh and manage an imported CSV
When data is loaded through Power Query, Excel keeps a query that describes the source and any transformation steps. To bring in an updated version, use Data > Refresh All or refresh the relevant query. If the source file was moved or renamed, the query may need its source path updated before it can refresh. Refreshing does not mean Excel will automatically discover a different file with a similar name; the query must still point to the intended source.
Before refreshing, consider whether the new file has the same column structure. If a supplier adds a column, changes a heading, or switches delimiters, existing steps may need review. After refresh, check the row count, headings, and a few representative values. This is especially important for recurring operational reports, because a successful refresh does not by itself prove that the source data was interpreted correctly.
Common problems and practical fixes
- Everything appears in one column: Reopen the import and select the actual delimiter. Check whether the source uses semicolons or tabs instead of commas.
- The headings are included as a data row: Open the query and select Home > Use First Row as Headers. Remove any title or blank rows above the actual headings first.
- Leading zeroes disappear: Set the relevant column to Text before loading, then import again from the original CSV if the zeroes have already been lost.
- Dates are reversed or unexpected: Check the source’s date convention and the locale used during conversion. Do not infer the intended month and day from an ambiguous value alone.
- Some characters look garbled: Re-import with the correct encoding or file-origin setting, often UTF-8 for modern exports.
- Values appear in the wrong columns: Inspect quoting and delimiter behavior in the preview. Fields that contain commas should be properly quoted in a well-formed CSV.
For a file from an unfamiliar source, treat its contents as data to review rather than assuming that every value is harmless or correctly typed. Check formulas, links, and unusual entries before using the imported content in a workbook or sharing it with others.
Frequently Asked Questions
How do I make the first row a header in Excel from a CSV?
Import the file through Data > From Text/CSV. If the preview does not recognize the first row as headings, select Transform Data, then choose Home > Use First Row as Headers in Power Query.
Does Excel automatically use the first CSV row as headers?
It may identify a header row during import, but you should verify the preview rather than rely on automatic detection. If the labels appear as ordinary data, promote the first row in Power Query before loading.
Can I import a CSV without losing leading zeroes?
Yes. In Power Query, set identifier columns such as postal codes or product IDs to Text before loading. If Excel has already removed zeroes, import again from the original CSV after changing the type.
Why does my CSV open in one column?
The delimiter Excel selected may not match the file. Use the import preview to try the separator used by the source, such as a semicolon or tab, and check that quoted text remains in a single field.
Can I refresh a CSV after importing it?
Yes, if it was imported as a Power Query connection. Use Data > Refresh All after the source is updated, and confirm that the query still points to the correct file and that the refreshed columns match expectations.
Related
- Excel Heat Map Over a Map: Methods, Data, and Setup
- Excel Heat Map UK: Create and Format One in Microsoft 365
- Excel Heat Map: How to Create and Customize One
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Calculate Age in Excel From a Birth Date, Step by StepTo calculate someone’s age in completed years in Excel, put their birth date in A2 and enter =DATEDIF(A2,TODAY(),"Y")…
- Wrap Text in Excel and Google Sheets: Step-by-StepTo wrap text, select the cell or range, then turn on wrapping: in Excel for Microsoft 365 on…
- Hanging Indent in Word: Step-by-Step InstructionsTo create a hanging indent in Word, select the paragraph or paragraphs, open the Paragraph settings from the…
- Excel Freeze Panes in Two Directions: Rows and ColumnsYes. In Excel for Microsoft 365 on Windows, you can freeze rows and columns at the same time:…
- Vacation Budget Spreadsheet by Day: Build and Use OneA vacation budget spreadsheet by day puts each travel date on its own row and groups expected costs…
- How to Insert a Digital Signature in WordIn Word for Microsoft 365 on Windows, add a visible signing area with Insert > Text > Signature…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.