Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Google Sheets UNIQUE Across Multiple Ranges

· 6 min read · Home Tech

In this article
  1. How UNIQUE works with combined ranges
  2. Combining ranges with different sizes
  3. Exclude blanks and sort the result
  4. Choose the right approach for your data
  5. Common errors and practical checks
  6. UNIQUE compared with alternatives
  7. Frequently Asked Questions

Yes. In Google Sheets, combine the ranges into one array and pass that array to UNIQUE. For example, if your lists are in A2:A10 and C2:C10, use =UNIQUE({A2:A10;C2:C10}) to return each distinct value once in a single column. The semicolon stacks the two ranges vertically; use a comma between ranges to place them side by side.

How UNIQUE works with combined ranges

UNIQUE returns distinct rows from the input array, keeping the first occurrence of each row and preserving the order in which values first appear. It does not combine separate range arguments by itself: the ranges must first be joined into one array, commonly with curly-brace array-literal syntax.

For a vertical result, put a semicolon between ranges inside the braces. With names in A2:A4 (Mia, Noah, Ava) and C2:C4 (Noah, Eli, Mia), =UNIQUE({A2:A4;C2:C4}) returns Mia, Noah, Ava, Eli. Repeated values are removed, and the first-seen order remains. The formula spills results into the cells below, so those cells need to be empty.

For a horizontal result, separate ranges with a comma: =UNIQUE({A2:A4,C2:C4}). This creates one row of values before UNIQUE evaluates it. Since UNIQUE compares rows by default, a one-row array is treated as a sequence of columns, and repeated values across that row are removed. Use the orientation that matches how you want the final result arranged.

Combining ranges with different sizes

Vertical stacking is often the simplest approach when lists have different numbers of entries, such as a short current list and a longer archive. For example, with values in A2:A20 and C2:C8, =UNIQUE({A2:A20;C2:C8}) stacks all the referenced cells into one column. The ranges must have compatible column counts for vertical stacking; for a single-column list, both ranges should be single columns.

For side-by-side stacking, the ranges need compatible row counts. If the ranges have different heights, a horizontal array may not form as intended. When ranges are uneven, either stack them vertically, or use a more deliberate setup that pads shorter ranges. Avoid assuming blank cells are harmless: a combined range can include blanks, and UNIQUE may return a blank as a distinct result.

If your source ranges contain headers, exclude those rows. For example, use A2:A20 rather than A1:A20 when A1 contains a heading. Otherwise, the heading is treated as data and may appear in the output as another unique item.

Exclude blanks and sort the result

To omit empty cells and alphabetize the result, combine FILTER, UNIQUE, and SORT. With single-column lists in A2:A20 and C2:C20, use =SORT(UNIQUE(FILTER({A2:A20;C2:C20},{A2:A20;C2:C20}<>""))). The repeated combined-array expression supplies the data and the condition: FILTER keeps nonblank entries, UNIQUE removes duplicates, and SORT orders the remaining values.

This formula is useful when ranges contain unused rows or formulas returning empty strings. A cell that looks blank because its formula returns "" is also excluded by the condition. If you want blanks to remain, use the simpler UNIQUE formula instead. Sorting changes the original first-seen order, so do not add SORT if the order in which values first appear matters.

You can also filter out a specific label or apply other conditions, but the condition array must have the same shape as the combined data array. For maintainability, keep the combined range expression consistent in both places and check the output after adding new source ranges.

Choose the right approach for your data

  • Use curly braces for a quick formula that combines a small number of ranges. Semicolons stack vertically; commas arrange ranges horizontally.
  • Use a larger continuous range when the lists are already stored in adjacent cells. For example, if all values are in A2:A100, there is no need to construct a multi-range array.
  • Use a helper column when the combined formula becomes difficult to maintain or when people need to inspect the merged list before deduplication.
  • Use a pivot table or another summary method when the goal is broader analysis, such as counting or grouping records, rather than simply creating a distinct list.

For a growing dataset, consider putting entries in one organized column rather than maintaining many separate ranges. A formula that references fixed ranges will not automatically include entries placed outside those references. Google Sheets does allow open-ended references such as A2:A, but they can include many empty rows; filter blanks when necessary.

Common errors and practical checks

If Sheets reports a formula parse error, check the separators inside the curly braces. In a vertical array, use a semicolon between the ranges; in a horizontal array, use a comma. Locale settings can affect formula argument separators, and array-literal separators may also vary by locale. If a formula copied from another region does not parse, consult the separators used by formulas in that spreadsheet rather than changing separators at random.

If the formula returns an unexpected blank, inspect the source ranges for empty cells, formulas returning empty strings, or accidental spaces. A cell containing a space is not the same as an empty cell, so a condition such as <>"" will not remove it. To clean text with leading or trailing spaces, a separate cleanup step may be needed; also note that values that look alike can differ because of spaces, capitalization, or data type.

If results do not appear, check for existing content in the cells where the array wants to spill. Clear those cells or move the formula to an empty area. Also check that the input ranges have the intended dimensions and that headers were excluded. UNIQUE removes exact duplicate rows or values; it does not standardize spelling, trim spaces, or treat every visually similar entry as identical.

UNIQUE compared with alternatives

For a current list that updates when source cells change, UNIQUE is generally more suitable than manually removing duplicates. Google Sheets also has a menu option under Data > Data cleanup > Remove duplicates. That tool edits the selected data, so it is not equivalent to a formula that produces a separate, automatically updated output. Use it when you want to clean the source itself and have checked which rows should be retained.

Unlike a spreadsheet workflow based on copying lists into a separate document, the array formula keeps the output linked to its sources. Unlike sorting alone, UNIQUE removes duplicate entries. Unlike UNIQUE alone, SORT changes the order. Choose based on whether you need a live list, a one-time cleanup, original appearance order, or alphabetic order.

Excel has a function also named UNIQUE, but the formula shown here is specifically written for Google Sheets array-literal syntax. Do not assume that curly-brace separators or array behavior will transfer unchanged between spreadsheet applications and locales; check the target application’s formula rules.

Frequently Asked Questions

Can Google Sheets UNIQUE use two ranges directly?
No. Put the ranges into one array first, such as =UNIQUE({A2:A10;C2:C10}) for two vertical lists, then pass that combined array to UNIQUE.

What does the semicolon mean in the formula?
In this vertical array example, the semicolon stacks the ranges one below the other. A comma places them side by side. Separators can depend on spreadsheet locale, so a parse error may require checking the local array syntax.

How do I get unique values from multiple ranges and ignore blanks?
Use FILTER to remove empty entries before or alongside UNIQUE. For two single-column ranges, =UNIQUE(FILTER({A2:A10;C2:C10},{A2:A10;C2:C10}<>"")) returns distinct nonblank values.

Does UNIQUE sort the results automatically?
No. It preserves the order of first appearances. Wrap the result in SORT if you want an ordered list, for example =SORT(UNIQUE({A2:A10;C2:C10})).

Why is a blank or duplicate-looking value still appearing?
The input may contain a blank, a formula returning an empty string, spaces, different capitalization, or values stored as different types. UNIQUE compares the actual contents, not only how cells appear on screen. Clean or filter the inputs if those distinctions should be ignored.