Key Takeaways
- FACET returns either a compact count table or one marker per source row, so the output shape is chosen before the formula is written.
- Flag mode replaces the COUNTIF helper column used in older workflows and writes a single column.
- Counts mode stops at 2000 distinct values so a large column cannot fill the sheet with results.
- The scheduled flag job handles long columns in chunks and runs on an active paid plan.
Repeated values in a Google Sheets column hide formatting differences that exact matching will not show. FACET gives two ways to inspect them before you clean anything. Counts mode returns each distinct value with the number of times it appears, sorted by the highest count. Flag mode writes one marker beside every row whose value occurs more than once, so you can filter and review candidates without building a second formula. Both modes read one column and keep the original values untouched. FACET needs an active paid licence, so the formula shows an upgrade notice until a plan is active on the Google account.
The seven supplier names below are used in both modes. Two rows hold the same text, and the legal suffix variants stay separate until you decide how to treat them.
Worked Example: Seven Supplier Names
| Cell | Supplier name in column A |
|---|---|
| A2 | Northwind Traders |
| A3 | Northwind Traders |
| A4 | Northwind Trader Ltd |
| A5 | Acme Corp |
| A6 | Acme Corp. |
| A7 | ACME Corporation |
| A8 | Jon Smyth |
Count Distinct Values with FACET
Enter this formula in C2:
=FACET(A2:A8)
The result spills two columns. The first holds the distinct value and the second holds its count. Rows are ordered by the highest count first, then by value. Place the formula where the next column is empty, because a Google Sheets array result cannot overwrite existing cells.
| Value in column C | Count in column D |
|---|---|
Northwind Traders | 2 |
ACME Corporation | 1 |
Acme Corp | 1 |
Acme Corp. | 1 |
Jon Smyth | 1 |
Northwind Trader Ltd | 1 |
The count table shows exact duplicates only. Acme Corp and Acme Corp. stay apart because the punctuation differs. To raise the cap above 2000 distinct values, supply a third argument, for example =FACET(A2:A5000, "counts", 5000). If the input has more distinct values than the limit, the function returns an error that points to flag mode.
Flag Repeated Rows with One Formula
Enter this formula in B2:
=FACET(A2:A8, "flag")
The output has the same height as the input and one column. A row receives CLUSTER when its exact value occurs more than once anywhere in the source range. Every other row receives an empty string. This replaces the older =IF(COUNTIF($A$2:$A$8,A2)>1,"CLUSTER","") helper, because the count is calculated once inside the function.
| Source row | Flag in column B |
|---|---|
| A2, Northwind Traders | CLUSTER |
| A3, Northwind Traders | CLUSTER |
| A4, Northwind Trader Ltd | Empty |
| A5, Acme Corp | Empty |
| A6, Acme Corp. | Empty |
| A7, ACME Corporation | Empty |
| A8, Jon Smyth | Empty |
Filter column B for CLUSTER to review only the rows that need a decision. A flag does not choose a canonical value. Record the value you keep beside the original, because a reviewer needs to see why a group was accepted.
Schedule the Flag Job
For columns too large for one formula call, open Extensions > Flookup Data Wrangler > Data Cleaning Automation and choose Flag repeated values. The job takes a single source column and an output range, then writes one marker per source row in chunks. Progress is saved between runs, and a scheduled run needs an active paid plan.
Counts mode is not offered as a batch job. It returns a compact table rather than one result per row, which does not fit the scheduler's row aligned output. The batch jobs guide lists all seven jobs and their inputs.
Frequently Asked Questions
What does the FACET function return in Google Sheets?
FACET returns either a table of distinct values with their counts or one CLUSTER marker per source row. Counts mode is the default. Flag mode is selected with the output_mode argument.
How do I flag repeated values without a second formula?
Use =FACET(A2:A8, "flag"). The result is a single column of CLUSTER markers beside the source rows, so no COUNTIF helper column is needed.
Can FACET run as a scheduled job?
Flag mode can run as a scheduled batch job for large columns. Counts mode stays a cell formula because it returns a compact table rather than one result per row. FACET needs an active paid licence for the cell formula and the scheduled job.