top of page

You are learning Sorting and Filtering in MS Excel

How to sort and filter data based on cell value case (uppercase/lowercase)?

Excel's built-in sorting doesn't inherently consider case sensitivity. However, you can achieve sorting and filtering based on cell value case (uppercase/lowercase) with a two-step approach:

Step 1: Create a Helper Column (Optional)

1. Insert a new column next to your data column.
2. In the helper column cells, enter a formula (e.g., in cell B2) that converts the corresponding data cell value (e.g., A2) to either uppercase or lowercase depending on your need. You can use the UPPER or LOWER functions for this:
- Uppercase: `=UPPER(A2)`
- Lowercase: `=LOWER(A2)`

Step 2: Sort/Filter Based on Helper Column (or Original Data Column)

1. Sort:
- Select the entire data range (including headers) that you want to sort.
- Go to the "Data" tab.
- Click "Sort" in the "Sort & Filter" group.
- Choose the helper column (with uppercase/lowercase values) or the original data column for sorting depending on your preference (original data column for case-sensitive sort).
- Select the sort order (ascending or descending).
- Click "OK" to sort.

2. Filter:
- Select the entire data range (including headers).
- Go to the "Data" tab.
- Click the filter dropdown arrow on the header of the chosen column (helper column or original data column).
- Select "Text Filters" and choose the appropriate filtering option based on case (e.g., "Begins with", "Contains", etc.).
- Enter your search criteria considering the case sensitivity (uppercase/lowercase) you want to filter by.

Note: If you don't want a helper column cluttering your sheet, you can directly use the original data column in the sort or filter steps. However, the sorting won't be truly case-sensitive, it will sort based on the character code of uppercase/lowercase letters.

bottom of page