Google Sheets Unique Sort Alphabetically: How-To
In this article
To get a unique, alphabetically sorted list in Google Sheets in one formula, use =SORT(UNIQUE(range)). UNIQUE strips out repeated values and SORT arranges what is left from A to Z, and because both are dynamic array functions the result updates itself whenever the source data changes. If you are working in Excel rather than Sheets, the equivalent is =SORT(UNIQUE(range)) in a recent version, or =UNIQUE(range) followed by a normal A–Z sort in older ones. Note that menu labels, function names and dialog wording can differ slightly by version, language and region, so treat the exact labels below as a guide.
What You'll Need
- A Google account with access to Google Sheets (the free web version is enough; the mobile app can run these formulas too, though typing them is easier on a computer).
- A sheet containing the data you want to de-duplicate, ideally with the values in a single column.
- An empty column or a separate area of the sheet where the cleaned list can spill its results. The formula needs roughly as many empty rows as your source has unique values.
- Rows and columns in that output area with nothing underneath them — anything already sitting there will block the spill and you will see a
#REF!error instead of a list.
Step-by-Step
- Put the data in one column. For the cleanest result, keep the values you want to sort in a single column with no blank rows in the middle. For example, put a list of supplier names in A2:A200 with a header in A1.
- Click the cell where the list should start. Pick an empty cell, usually in a neighbouring column such as C2, and leave the cells below and to the right of it empty. This is where the sorted, unique list will spill out.
- Type the basic formula. Enter
=UNIQUE(A2:A200)and press Enter. You should now see each distinct value once. This confirms the de-duplication part works before you add sorting. - Wrap it in SORT. Change the formula to
=SORT(UNIQUE(A2:A200)). SORT defaults to ascending order, which gives you alphabetical A-to-Z automatically. For names or any text, that is exactly the alphabetical sort you want. - Sort by a different column if you have two. If your source has, say, names in A and departments in B and you want unique name-and-department pairs, use
=SORT(UNIQUE(A2:B200), 1, TRUE). The1means sort by the first column of the output andTRUEmeans ascending. UseFALSEfor Z-to-A. - Decide whether to keep the header. Sorting a range that includes a header will place the header in alphabetical order among the data, which is usually not what you want. Either start the range at the first data row (as in the examples above) or wrap the formula so a header is kept separately: type your header label in the cell above the output, then place the formula one row below it.
- Case and spacing matter. UNIQUE treats "Acme" and "acme" as two different values, so tidy obvious inconsistencies in the source first (find-and-replace is quick for this). Otherwise your "unique" list will contain near-duplicates.
- Verify against the source. Scroll the source column and check that every value you expect appears once, and that any missing value is genuinely missing from the source rather than hidden by a trailing space.
- Test the live update. Type a new name at the bottom of the source column. The output list should re-sort itself without any action from you. Delete it again and confirm the list shrinks.
Common Mistakes
- Filling the formula down. UNIQUE and SORT return arrays that spill on their own. Dragging the fill handle down creates duplicate output columns and
#REF!errors. Enter the formula once, in one cell. - Output area not empty. If any cell in the spill range already contains data, even a stray space, the formula cannot expand. Clear the area below and to the right of your starting cell.
- Sorting a mixed range.
=SORT(UNIQUE(A:B))where column B is mostly empty will sort by column A but carry a lot of blanks through UNIQUE. Restrict the range to the rows that actually contain data, or useFILTERto exclude blanks. - Expecting it to sort numerically as text. SORT handles numbers correctly as numbers, but values stored as text (for example numbers pasted with an apostrophe or imported as text) sort character by character, so "10" can come before "2". Convert them to real numbers if the order looks odd.
- Forgetting trailing spaces. "Widget " and "Widget" look identical on screen but are different values to UNIQUE. TRIM helps here.
- Pasting over the result. If you later paste a static list on top of the spill area, the formula breaks. Keep the formula's output zone clear, or copy the output and use Paste special > Values only elsewhere.
Tips
- Combine with TRIM to kill hidden spaces:
=SORT(UNIQUE(TRIM(A2:A200))). This removes the leading and trailing spaces that quietly create duplicates. - Add a condition:
=SORT(UNIQUE(FILTER(A2:A200, A2:A200<>"")))returns unique, sorted values while dropping every blank cell, which is handy when your source list is still growing. - Count each occurrence alongside the list with
=COUNTIF(A2:A200, C2), where C2 is the first output value, then fill that count formula down a single column. - If you only need a one-off clean list, you can also use Data > Create a filter on the source column, then use the filter's unique-values option if available in your version, or copy the column elsewhere and use Data > Data cleanup > Remove duplicates. The formula approach is better when the source will keep changing.
- Name your source range (Data > Named ranges) so formulas read like
=SORT(UNIQUE(Suppliers)), which is easier to audit later. - Freeze the header row (View > Freeze) so the sorted output still makes sense when you scroll.
Troubleshooting
You see #REF! with "Array result was not expanded". Something is in the way. Select the cells below and to the right of your formula, clear them, and the list should appear. If you cannot find the blocker, move the formula to a completely empty sheet area.
You see #NAME?. A function name is misspelled or the sheet does not recognise it. Check that you typed UNIQUE and SORT with no stray characters, and that commas separate the arguments — some regional settings use semicolons instead of commas, so try =SORT(UNIQUE(A2:A200); 1; TRUE) if commas fail.
The list is not alphabetical. Confirm SORT is wrapping UNIQUE rather than the other way round. =UNIQUE(SORT(A2:A200)) also works, but =SORT(UNIQUE(...)) is more predictable. Also check for leading spaces or a leading apostrophe, which change where a value sorts.
Values are missing. The range is probably too short. If your source now runs to row 500 but the formula stops at 200, extend it or use an open-ended range like A2:A.
The list will not update. Look for Calculation settings under File > Settings; if iterative calculation or manual recalculation has been switched on, the sheet may not refresh automatically. Set it back to automatic, or press Ctrl+Shift+F5 on Windows (Cmd+Shift+F5 on Mac) if your version supports a hard refresh.
The output looks frozen as plain text. Someone may have pasted values over the spill. Delete the pasted cells and re-enter the formula.
Frequently Asked Questions
Can I sort Z to A instead?
Yes. Use =SORT(UNIQUE(A2:A200), 1, FALSE). The final FALSE reverses the order.
Does this work in the Google Sheets mobile app?
Yes, the formulas behave the same. Type them in the formula bar, and allow space below the cell for the results to spill, exactly as on desktop.
Will it ignore capitalisation when finding duplicates?
No. UNIQUE is case-sensitive, so "ACME" and "Acme" count as two entries. Normalise the case in the source first if you want them merged.
How do I keep my header row out of the sort?
Start the range at the first data row, such as A2 instead of A1, and type the header label separately in the cell above the formula's output.
Can I remove duplicates permanently instead of with a formula?
Yes. Copy the column, paste it into a spare area, select it and use Data > Data cleanup > Remove duplicates. This edits the data in place, so work on a copy if the original matters.
Why does my list show blanks?
UNIQUE keeps empty cells if the range includes them. Filter them out with =SORT(UNIQUE(FILTER(A2:A200, A2:A200<>""))).