ExcelReady
CourseMock testsFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before day one. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Mock tests
  • Function guides
  • Blog

Test prep

  • Excel level test
  • Excel test practice
  • Free screening quiz
  • Certificate

Company

  • About
  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Dynamic arrays
  3. Get Unique Values From Multiple Columns in Excel

Get Unique Values From Multiple Columns in Excel

By ExcelReady Team·Updated November 2, 2026·7 min read

The short answer

To get unique values from multiple columns in Excel, turn the columns into one list with TOCOL, then pass it to UNIQUE: =UNIQUE(TOCOL(A2:C5,1)). The 1 skips blank cells. Wrap it in SORT for an A to Z list. TOCOL needs Microsoft 365 or Excel 2024. In older versions, stack the columns into one and use Remove Duplicates.

Key takeaways

  • UNIQUE on a multi-column range returns unique rows, not unique values. Flatten the range with TOCOL first.
  • =SORT(UNIQUE(TOCOL(A2:C5,1))) lists every distinct value from three columns, A to Z, without blanks.
  • Use VSTACK to combine columns that are not next to each other, or that sit on different sheets.
  • COUNTA around the formula counts the unique values.
  • TOCOL and VSTACK need Microsoft 365 or Excel 2024. Older versions can stack the columns and use Remove Duplicates.
On this page+
  1. Why UNIQUE alone doesn't work on several columns
  2. How to get unique values from multiple columns with TOCOL
  3. How to combine columns that aren't next to each other
  4. How to count unique values across multiple columns
  5. How to get unique rows (combinations) instead
  6. Another formula: TEXTJOIN and TEXTSPLIT
  7. How to do it in Excel 2021 and older versions
  8. Common problems
  9. Practise it

To get unique values from multiple columns in Excel, first turn the columns into one list, then remove the repeats. In Microsoft 365 and Excel 2024, one formula does both: =UNIQUE(TOCOL(A2:C5,1)). This guide explains why UNIQUE alone doesn't do it, shows how to sort, count and combine separate lists, and gives two methods for older versions of Excel.

The examples use a small shift rota in A1:C5. Some names appear in several weeks, and B4 is empty.

ABC
1Week 1Week 2Week 3
2AnaBenAna
3BenCaraDev
4CaraBen
5EliAnaCara

Five different people worked: Ana, Ben, Cara, Dev and Eli. The goal is a formula that lists those five, once each.

Why UNIQUE alone doesn't work on several columns#

UNIQUE compares whole rows when you give it more than one column. So =UNIQUE(A2:C5) returns all four rows unchanged, because no two rows are exactly the same. Ana still appears three times.

That is useful when you want unique combinations (more on that below), but not when you want one list of values. The fix is to flatten the columns into a single column first. The UNIQUE function guide covers the other arguments, and the article on the UNIQUE function covers the single-column basics.

How to get unique values from multiple columns with TOCOL#

TOCOL turns any range into one column. UNIQUE then removes the repeats.

Excel formula
=UNIQUE(TOCOL(A2:C5,1))

Type it in an empty cell, such as E2, and the result spills down into the cells below (it fills them automatically):

E
Ana
Ben
Cara
Dev
Eli
  • TOCOL(A2:C5,1) reads the range into one column. The 1 tells it to skip blank cells. Without it, the empty B4 becomes a 0 in your list.
  • UNIQUE(...) keeps the first appearance of each name.

TOCOL reads row by row by default: Ana, Ben, Ana, then Ben, Cara, Dev, and so on. To read column by column instead, add TRUE as the third argument: =UNIQUE(TOCOL(A2:C5,1,TRUE)) returns Ana, Ben, Cara, Eli, Dev, the order in which each name first appears going down Week 1, then Week 2, then Week 3.

TOCOL needs Microsoft 365 or Excel 2024. For Excel 2021 and older, see the last method below.

How to sort the unique list#

Wrap the formula in SORT for an A to Z list:

Excel formula
=SORT(UNIQUE(TOCOL(A2:C5,1)))

For Z to A, add the sort order: =SORT(UNIQUE(TOCOL(A2:C5,1)),,-1). The two commas skip SORT's second argument, which picks the column to sort by. The SORT function guide explains every argument, and the article on a sorted unique list shows more ways to sort the results.

How to combine columns that aren't next to each other#

TOCOL needs one block of cells. If your lists are in columns that aren't side by side, or on different sheets, join them with VSTACK first. VSTACK stacks ranges on top of each other.

Excel formula
=SORT(UNIQUE(TOCOL(VSTACK(A2:A5,C2:C5),1)))

This combines Week 1 and Week 3 only and returns Ana, Ben, Cara, Dev, Eli. Across sheets, the pattern is the same:

Excel formula
=SORT(UNIQUE(TOCOL(VSTACK(North!A2:A50,South!A2:A50),1)))

Keep TOCOL with the 1 around VSTACK: it removes the blanks at the bottom of each range. VSTACK needs Microsoft 365 or Excel 2024. The guide to combining data from multiple sheets covers VSTACK and Power Query in more detail.

How to count unique values across multiple columns#

To count instead of list, wrap the formula in COUNTA:

Excel formula
=COUNTA(UNIQUE(TOCOL(A2:C5,1)))

The result is 5. Make sure TOCOL has the 1, or the blank cell is counted as an extra value. The article on counting unique values shows other counting methods, including ones for older Excel.

How to get unique rows (combinations) instead#

Sometimes "unique from multiple columns" means unique combinations, such as every Region and Product pair that appears in a sales list. That is what UNIQUE does on its own when you give it several columns:

AB
1RegionProduct
2NorthLaptop
3SouthLaptop
4NorthLaptop
5NorthMonitor

=UNIQUE(A2:B5) returns three rows: North Laptop, South Laptop and North Monitor. Row 4 is dropped because it repeats row 2 exactly. UNIQUE and SORT need Excel 2021 or Microsoft 365. The modern Excel functions lesson practises spill formulas like this.

Another formula: TEXTJOIN and TEXTSPLIT#

You can also join every value into one long piece of text and split it back into a column. This is the method in the exercise on this page:

Excel formula
=SORT(UNIQUE(TEXTSPLIT(TEXTJOIN(",",TRUE,A2:C5),,",")))

TEXTJOIN joins the names with commas and skips blanks (that is the TRUE). TEXTSPLIT splits at each comma, and the two commas before "," mean "split into rows, not columns". It returns the same five names. Like TOCOL, TEXTSPLIT needs Microsoft 365 or Excel 2024, so TOCOL is usually the simpler choice. The join-and-split trick has limits: it breaks if a value contains a comma, numbers come back as text, and TEXTJOIN can't return more than 32,767 characters.

How to do it in Excel 2021 and older versions#

Without TOCOL, VSTACK or TEXTSPLIT, stack the values by hand and then remove the repeats:

  1. Copy each column and paste it under the first one, so all values sit in one column.
  2. Select that column and choose Data > Remove Duplicates, then click OK.
  3. Sort it with Data > Sort A to Z if you like.

This works in every version, but the list does not update when the data changes. In Excel 2021 you can keep it live instead: keep the stacked column as a helper column and point =SORT(UNIQUE(...)) at it, so new names added to the helper column appear in the list. The comparison of UNIQUE vs Remove Duplicates explains when each one fits.

Common problems#

  • A 0 in the list. TOCOL is missing the 1, so a blank cell became 0.
  • #SPILL! The cells below the formula aren't empty. Clear them so the list has room.
  • Near-duplicates. "Ana" and "Ana " (with a trailing space) are different to UNIQUE. Clean them with TRIM: =UNIQUE(TRIM(TOCOL(A2:C5,1))).
  • Capitals. UNIQUE isn't case-sensitive, so "ana" and "Ana" count as one, and the first spelling wins.

Practise it#

Try the exercise on this page: it uses the join-and-split method on the shift rota, and you can check that five names come back. Then practise the UNIQUE function in a live spreadsheet, where you type each formula and see the spill result checked instantly.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

List every person who worked a shift, once each and A to Z. The practice sheet doesn't support TOCOL, so use the join-and-split method in E2: =SORT(UNIQUE(TEXTSPLIT(TEXTJOIN(",",TRUE,A2:C5),,","))).

fx
ABCDEF
1
Week 1
Week 2
Week 3
Everyone
2
Ana
Ben
Ana
3
Ben
Cara
Dev
4
Cara
Ben
5
Eli
Ana
Cara
6
7
8

Tip: TEXTJOIN joins all the names with commas, TEXTSPLIT splits them back into one column, then UNIQUE and SORT tidy the list.

Practise this in a lesson

LessonUNIQUE: list and count distinct valuesPull a clean list of distinct regions or customers with UNIQUE, then count them with COUNTA.LessonModern Excel: XMATCH, SORTBY, TEXTSPLIT and spill references (A2#)Split names with TEXTSPLIT, find positions with XMATCH, sort by another column with SORTBY, and refer to a whole spilled result with A2#.Function guideUNIQUEList distinct values with Excel's UNIQUE, count them with COUNTA, or find items that appear only once. Examples plus a live exercise.Function guideSORTSort a range with a formula using Excel's SORT. Sort by any column, highest first, or combined with FILTER. Includes a live exercise.

Frequently asked questions

How do I get unique values from two columns in Excel?

+

If the columns are side by side, use =UNIQUE(TOCOL(A2:B20,1)). If they are apart or on different sheets, stack them first: =UNIQUE(TOCOL(VSTACK(A2:A20,D2:D20),1)). Both need Microsoft 365 or Excel 2024.

Why does UNIQUE return the same names more than once across columns?

+

On a range with several columns, UNIQUE compares whole rows, so it returns unique rows rather than unique values. Turn the range into a single column with TOCOL first.

How do I count unique values across multiple columns?

+

Wrap the list in COUNTA: =COUNTA(UNIQUE(TOCOL(A2:C5,1))). The 1 in TOCOL skips blanks so they aren't counted as a value.

How do I get unique values from multiple columns without UNIQUE?

+

Copy each column into one long column, select it and use Data > Remove Duplicates. The result does not update by itself, so repeat it when the data changes.

Is UNIQUE case-sensitive?

+

No. UNIQUE treats Ana and ANA as the same value and keeps the first one it finds. Extra spaces do count as a difference, so clean the data with TRIM first.

Sources

  • UNIQUE function - Microsoft Support
  • SORT function - Microsoft Support
  • TEXTSPLIT function - Microsoft Support

Written and checked by the ExcelReady Team. First published November 2, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. Why UNIQUE alone doesn't work on several columns
  2. How to get unique values from multiple columns with TOCOL
  3. How to combine columns that aren't next to each other
  4. How to count unique values across multiple columns
  5. How to get unique rows (combinations) instead
  6. Another formula: TEXTJOIN and TEXTSPLIT
  7. How to do it in Excel 2021 and older versions
  8. Common problems
  9. Practise it

Keep reading

Dynamic arrays· 7 min read

The UNIQUE Function in Excel

The UNIQUE function returns each different value in a range once, in the order it first appears: =UNIQUE(C2:C9). Type it in one cell and the results spill into the cells below. Wrap it in COUNTA to count distinct values, or in SORT to put them in order. UNIQUE needs Excel 2021, Excel 2024 or Microsoft 365.

Dynamic arrays· 6 min read

Make a Sorted List of Unique Values in Excel

To make a unique sorted list in Excel, wrap UNIQUE inside SORT: =SORT(UNIQUE(B2:B9)). UNIQUE removes the repeats and SORT puts what is left in A to Z order. The list spills down and updates when the data changes. Use =SORT(UNIQUE(B2:B9),,-1) for Z to A. Both functions need Excel 2021, Excel 2024 or Microsoft 365.

Data tools· 5 min read

Combine Data From Multiple Sheets in Excel

To combine data from multiple sheets in Excel, stack the ranges with VSTACK in Microsoft 365 or Excel 2024: =VSTACK(Jan!A2:C4,Feb!A2:C4) puts February's rows under January's and updates by itself. In older versions, use Power Query's Append command, or Data > Consolidate when you only need totals by label. For a one-off job, copy and paste.

More on dynamic arrays

  • Auto Number Rows in Excel (SEQUENCE and ROW)
  • Count Unique Values With Criteria in Excel
  • Dynamic Arrays in Excel Explained Simply
  • Dynamic Drop-Down Lists in Excel That Update Themselves
  • Sum, Count or Average FILTER Results in Excel
  • FILTER by Date in Excel: Month, Range or Recent
All dynamic arrays articles →

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback, right in your browser. Nothing to download.

Start learning for free