How to Import a CSV into Excel and Create a Monthly Sales Line Chart
Steps
To import a CSV into Excel and create a monthly sales line chart, load the file through Data > From Text/CSV, check its data types, summarize sales by month in a PivotTable, and insert a line PivotChart. This workflow gives you a report you can refresh when the source data changes. (support.microsoft.com)
What do you need before importing your CSV?
You need a CSV containing a date column and a numeric sales column, plus desktop Excel with the From Text/CSV import command. These instructions follow Excel for Windows; menu placement can differ by platform and version. Importing through this command lets you inspect the data before loading it. (support.microsoft.com)
Prepare your file with this checklist:
- Use one header row with clear names, such as Order Date and Sales.
- Keep one transaction or sales record per row.
- Remove summary rows so totals are not counted twice.
- Use consistent dates and numbers within each column.
- Keep an untouched copy for checking your results.
A clean, tabular layout with consistent column types makes the data suitable for a PivotTable. (support.microsoft.com)
Import the file and build your monthly chart
- Open Excel and select the CSV import command.
- Start with a blank workbook. Select Data > From Text/CSV, or Data > Get Data > From File > From Text/CSV, depending on your ribbon layout. Browse to the file, select it, and choose Import. (support.microsoft.com)
- For this workflow, avoid simply double-clicking the source file. Opening a CSV directly uses Excel’s default conversion settings; importing gives you more control over how columns are interpreted, especially dates and identifiers with leading zeros. (support.microsoft.com)
- Check the preview and correct the delimiter.
- Inspect the preview before loading anything. Each field should occupy its own column, and the header names should match the data underneath. If an entire row appears in one column, change the Delimiter setting to match the file, such as comma or semicolon. (learn.microsoft.com)
- Check names containing accented characters, too. If they look garbled, review the file-origin or encoding setting. The expected outcome is a readable preview with dates, sales amounts, and other fields separated correctly. Select Transform Data to inspect the column types before loading. (learn.microsoft.com)
- Set the date and sales data types.
- In Power Query Editor, select Order Date and set its data type to Date. Set Sales to an appropriate numeric type, such as Decimal Number. If you need order codes with leading zeros, treat those identifiers as Text, not numbers. (support.microsoft.com)
- Inspect several records rather than trusting automatic detection. Check dates whose day and month could be confused, and compare a few sales amounts with the original export. Resolve conversion errors before continuing: a chart cannot compensate for incorrectly interpreted source values.
- Select Home > Close & Load to load the cleaned data into the workbook. Keep this imported table separate from your monthly summary so you can inspect individual transactions later. (support.microsoft.com)
- Create a PivotTable and total sales by month.
- Click inside the imported table, choose Insert > PivotTable, and place it on a New Worksheet. Drag Order Date into Rows and Sales into Values. Confirm that the value field reads Sum of Sales, not Count of Sales. (support.microsoft.com)
- Right-click a date in the PivotTable and select Group. Choose Months and Years, clear unwanted intervals, and select OK. Keep Years above Months in the Rows area so the report separates each year’s monthly results. (support.microsoft.com)
- Before charting, compare the PivotTable grand total with your source report. Investigate differences now, including duplicate records, summary rows, or filters that exclude transactions.
- Insert and format the monthly sales line chart.
- Select a cell in the PivotTable, choose Insert > PivotChart, and select a standard Line chart or Line with Markers. The chart uses your PivotTable summary, so you can adjust its fields through the field list. (support.microsoft.com)
- Give it a descriptive title, such as Monthly Sales, and make the sales currency clear. Check that months run chronologically and that years remain visible when the report spans multiple years. Favor a simple line, readable labels, and restrained gridlines over decorative effects.
- Review the highest and lowest points against the monthly totals. If a month is absent, investigate whether the export lacks records; do not assume missing data means zero sales.
- Save the report and test a refresh.
- Save the workbook as Excel Workbook (.xlsx) rather than CSV. CSV stores worksheet text and values, not the complete report’s charts, formatting, and additional sheets. This completes the conversion without discarding your reporting work. (support.microsoft.com)
- To update the report, update the source CSV and select Data > Refresh All. Wait for the imported table to finish updating, then refresh the PivotTable before checking the chart. Verify the newest month and save again. (support.microsoft.com)
What should you check if the results look wrong?
Check the imported columns and PivotTable settings before rebuilding the chart. Incorrect delimiters affect column separation, inconsistent data types affect calculations, and grouping settings control the monthly summary. (learn.microsoft.com)
- Sales show as counts: Confirm that Sales contains numbers, then change the value calculation to Sum. (support.microsoft.com)
- Dates appear incorrectly: Recheck the date conversion against the original export before grouping. (support.microsoft.com)
- New transactions are missing: Refresh the imported table first, then refresh the PivotTable. (support.microsoft.com)
FormMaster
Like