Why does Excel UNIQUE retain a repeated code?

Two adults examine four cards with coloured circles and a square beside a laptop and notebook.

Key points

  1. Write the required list in plain language.
  2. Keep the selected scope visible.
  3. Separate a list from decisions about people or records.

What does the option mean?

UNIQUE defaults to distinct rows; exactly_once=TRUE selects single occurrences. For a fictional one-column A,A,B list: A,B versus B. Microsoft guidance.

This is an illustration derived from the documented rule, not an executed Excel test. Before investigating a supposed failure, ask the requester to describe the required list without using the ambiguous instruction “make it unique”.

What should the requester decide first?

Ask what the output will be used for. A catalogue of codes for a meeting and a review queue for unusual activity have different purposes. Give each proposed output an explicit name and ask its owner to approve the inclusion rule before a colleague builds it.

For a small fictional review, write the expected inclusion decision beside each sample code. Resolve disagreements in that written requirement rather than editing the source until the list looks convincing. Keep the requirement alongside the eventual implementation.

Hands arrange two blue-circle cards and an orange-square card beside empty trays and a notebook.

Which records belong in the comparison?

Record the source file, selected columns, covered period and any intentional exclusions. Ask whether the request concerns a product code, an order reference or an entire operational record. These are decisions about the question, not interchangeable labels for the same task.

A list taken from one branch for one month cannot establish a person’s complete history. Equally, an abbreviated name is not evidence that two entries concern the same person. Do not use the output alone to authorise merging records or contacting customers.

How can you check the intended result safely?

Preserve the source and prepare an authorised, non-sensitive example set. Write expected decisions first, then let the responsible person compare them with the actual output in the intended environment. Record the workbook version, input scope and observations separately from expectations.

If an example behaves differently, report the exact input and requirement that disagree. Do not quietly broaden the task into deleting rows or normalising identifiers. A retained source reference makes it easier to investigate without treating the output as the entire dataset.

What should accompany the finished list?

Include the agreed purpose, scope, approval status and a route back to the source. Mark any unresolved cases explicitly. The person using the list should know whether it is an exploratory aid or an approved input to another process.

This article has not opened or calculated a workbook. It does not provide a universal compatibility or identity check. Before operational use, the implementation and its receiving environment still need an agreed review.

Need to clarify a data handover?

Discuss workflow requirements with HKONE. Spreadsheet implementation and integration require separate scoping.

Frequently asked questions

Does UNIQUE compare just the code in a two-column range?

No: default comparison covers both values in each row. Microsoft guidance.

Does an absent code prove its source records were deleted?

No. Do not infer deletion from this list. Check the original records and the approved selection requirement before drawing that conclusion.

Can one occurrence in this month’s data prove a customer bought only once?

No. That conclusion needs verified identity and relevant history beyond the selected period. Do not label lifetime behaviour from a limited extract.

Should the source be changed to make the output match expectations?

Not merely for that purpose. Preserve the evidence, clarify the requirement and investigate the discrepancy with the data owner.

What should be recorded if colleagues expect different lists?

Record both proposed inclusion rules and their intended uses. Ask the requester to approve the required decision before changing the implementation.

About the author: This article was written by the HKONE team. HKONE is a Hong Kong digital marketing and AI automation company providing social media management, website design, AI customer service and GEO / SEO for SMEs. Where this article mentions platform fees or policies, the platform's official information takes precedence.

Tell us about your business first. Then decide.

The consultation is free. We will understand your situation before recommending a plan and a quote.