← All how-to recipes

How to combine two lists without duplicates

✓ Verified in LibreOffice 25.8.7.3 ✓ Verified in Google Sheets (2026-08-30)

Merge two columns into one list where each value appears only once.

The formula

AppFormulaNotes
Excel (desktop)=UNIQUE(VSTACK(A2:A4,C2:C3))Excel 365. VSTACK stacks the ranges; UNIQUE dedupes the result.
Google Sheets=UNIQUE({A2:A4;C2:C3})Sheets uses {range1;range2} array literals instead of VSTACK (though VSTACK also works).
LibreOffice Calc=UNIQUE(VSTACK(A2:A4,C2:C3))Needs LibreOffice 25.8+ (VSTACK); UNIQUE alone needs 24.8+.

How it works

VSTACK places the second range under the first (apple, banana, apple, banana, cherry) and UNIQUE removes the repeats, leaving each value once. The output is live — edits to either source list update the merged result. In Google Sheets the {A2:A4;C2:C3} literal does the stacking; the semicolon means "stack vertically" (locale note: some European locales swap ; and , in array literals).

Verified, not just documented

We ran =UNIQUE(VSTACK(A2:A4,C2:C3)) in LibreOffice 25.8.7.3 (headless, with forced recalculation) and it returned apple, banana, cherry — exactly the expected result. We then ran the same formulas in Google Sheets, executed 2026-08-30: a formula-only workbook goes into Google Drive, which converts it to a Sheet and recalculates every formula with Google’s own engine, and comes back out as .xlsx carrying the values Google computed. It returned apple, banana, cherry for the worked example, the same value LibreOffice produced. Both engines’ numbers on this page are executed results. The Excel formula follows Microsoft’s official documented syntax — we do not run desktop Excel.

Functions used

UNIQUE · VSTACK — see full Excel, Google Sheets & LibreOffice compatibility for each.

Related recipes

Related comparisons