Method 1 – Sort CSV File Automatically with Columns in Excel
- Create a text file like this with the information of Product, Quantity and Sales Amount for 5 types of fruits.

- Open a new Excel workbook.
- Go to the Data tab and click on Get Data under the Get & Transform Data group.

- Select From Text/CSV under the From File group in the drop-down section.

- Select the CSV file from your device folder and press Import.

- See the preview window.
- Select the File Origin as 65001: Unicode (UTF- 8) and Delimiter as Comma.

- Press Load and you will get the CSV file in Excel.

- Select the cell range D3:D7 and right-click on it.
- Choose the Format Cells option in the Context Menu.

- Select Accounting in the Number section and change the Symbol according to your preference.
- Press OK to get the Sales Amount as per the CSV file.

- Sorting the dataset, go to the Data tab and select Sort.

- Select the category Quantity in the Sort by section.
- Select the order Smallest to Largest under the Order section in the Sort window.

- Get the CSV file with columns in a sorted way like this.

- Filter the CSV file, simply click on the Filter icon beside any of the headers.
- Filter the category in the Text Filters section.

- Because you deselected Kiwi and Orange, the final output is not showing the information related to these categories.

Method 2 – Organize CSV File in Excel Without Column
- Go to the File tab of the workbook.

- Click on Save As from the left panel.

- Select CSV UTF-8 (Comma delimited) (*.csv) as the file type and press Save.

- Get the CSV file as text and without columns like this.

- Ornament the dataset from the Font section in the Home tab.

- The dataset will look like this.

- Sort this CSV file.
- Go to the Home tab and click on Sort & Filter.

- Select any of the options in the drop-down menu for sorting the file.

- Select Custom Sort to sort it more precisely.

- Select the category Sales Amount in the Sort by section.
- Choose the Order as Largest to Smallest.

- Lastly, press OK and you will successfully sort the CSV file like this.

- Filter the dataset by clicking on the Filter icon in the Sort & Filter drop-down.

- You will notice the filter icon beside each header title.
- Filter the dataset according to your preference as we described in the first method.

Select the immediate next row of the header > go to the View tab > select Freeze Panes in the Window group.

Download Practice Workbook
Download this sample file to practice by yourself.
Related Articles
- How to Fix CSV File in Excel
- How to Edit CSV File in Excel
- How to Merge CSV Files in Excel
- Merge CSV Files into Multiple Sheets in Excel
- Formatting CSV File in Excel
- How to Stop Excel from Auto Formatting Dates in CSV
<< Go Back to Import CSV to Excel | Importing Data in Excel | Learn Excel
Get FREE Advanced Excel Exercises with Solutions!

