Advanced Excel for Data AnalystsLesson 39 of 49
Lesson 39 of 49

Distinct Value Extraction & Frequency Counters: UNIQUE

Overview & Learning Objectives

In high-volume transaction sheets with 50,000 rows, cities, customer names, and categories repeat thousands of times. The UNIQUE function extracts a clean, deduplicated list in 1 second, perfect for populating dropdown lists and summary cards.

  • Extract distinct items dynamically using `=UNIQUE(array)`.
  • Combine SORT with UNIQUE to build clean alphabetical lookup lists: `=SORT(UNIQUE(...))`.
  • Use the `exactly_once` parameter to isolate records that occur strictly once.

Industry Standard

Standard: Marketing and supply chain teams use UNIQUE to generate dynamic master lists for reporting filters and cohort tracking.

Real-World Example: Quick Delivery Distinct Localities & Customers

Your delivery hub processed 500 orders across Bengaluru. Localities like "Indiranagar" and "Koramangala" repeat 80 times each. Entering `=SORT(UNIQUE(Orders[Locality]))` gives a clean alphabetical list of all active delivery zones.

Order IDCustomer CityLocality NameOrder Value (₹)
ORD-101BengaluruKoramangala450
ORD-102BengaluruIndiranagar620
ORD-103BengaluruKoramangala390
ORD-104BengaluruWhitefield850

UNIQUE Function Syntax

=UNIQUE(array, [by_col], [exactly_once])

Parameters Breakdown

  • array: The column of raw data containing duplicates (e.g. C2:C5).
  • [by_col]: FALSE (default) compares rows; TRUE compares columns.
  • [exactly_once]: Set TRUE to extract only items that appear strictly ONCE (pure non-duplicates).

Sample Walkthrough (Q&A):

Question: How do you extract a clean, alphabetical list of all distinct localities from Column C?

Formula / Action: `=SORT(UNIQUE(C2:C5))`

Result: Spills: Indiranagar, Koramangala, Whitefield.

Explanation: UNIQUE strips the repeated "Koramangala", and SORT alphabetizes the result.

Common Mistakes & Limitations

  • Confusing distinct values (each item appears once in output) with `exactly_once` values (items that never repeat).
  • Using the static "Remove Duplicates" button on source data, permanently destroying raw order transaction history.

Keyboard Shortcuts

ActionWindowsMac
Reference Spilled Unique ListType Anchor Cell + # (e.g. =M2#)Type M2#
Create Dropdown from SpillData Validation -> Source: =M2#Source: =M2#

Pro Tips & Modern Alternatives

  • Feed dynamic dropdowns: in Data Validation, set List Source to `=M2#`. As new cities are added to orders, the dropdown updates automatically!
  • Count distinct items: `=COUNTA(UNIQUE(C2:C100))` gives the exact count of unique active localities.