HomeGoogle DocsSpreadsheetFilter (Also Highlight) Unique Digit Numbers in Google Sheets

Filter (Also Highlight) Unique Digit Numbers in Google Sheets

Have you ever needed to find numbers where each digit appears only once? That’s exactly what this tutorial is about — how to filter (also highlight) unique digit numbers in Google Sheets.

Think of numbers like 12345 — every digit is different. But 12344? That one repeats the digit 4, so it doesn’t qualify. This trick is surprisingly useful in real life! I’ve used it to check serial numbers, spot cleaner data entries, and even for fun stuff like analyzing lottery picks.

Whether you’re working with PINs, raffle entries, product IDs, or just enjoy playing with numbers, this method helps you quickly identify the ones that stand out — without any repeats.

In this post, I’ll walk you through how to filter (also highlight) unique digit numbers in Google Sheets using formulas, step by step.

Let’s dive in!

How to Filter Unique Digit Numbers in Google Sheets

Assume you have PINs in column B (starting from B2) and you want to filter all the unique digit PINs from this list.

Example Data:

PIN Numbers
1234
4456
3216
6548
4425

You can use the following formula to filter numbers with all unique digits:

=FILTER(B2:B, MAP(B2:B, LAMBDA(row, LEN(row)=COUNTA(UNIQUE(MID(row, SEQUENCE(LEN(row)), 1))))))

Output:

Unique PINs
1234
3216
6548
If you're using this formula for a different range, replace B2:B with your actual range.

Formula Explanation

Let’s break it down:

  • MID(row, SEQUENCE(LEN(row)), 1) – splits each digit of the number into separate cells.
  • UNIQUE(...) – removes any repeated digits.
  • COUNTA(...) – counts how many unique digits remain.
  • LEN(row)=COUNTA(...) – returns TRUE only if all digits were unique (i.e., length of the number equals count of unique digits).
  • MAP(...) – applies this logic to every row in the given range.
  • FILTER(...) – returns only the rows for which the above logic is TRUE.

That’s how the formula filters unique digit numbers in Google Sheets.

How to Highlight Unique Digit Numbers in Google Sheets

To highlight unique digit numbers in the range B2:B:

  1. Select the range B2:B.
  2. Go to Format > Conditional formatting.
  3. Under “Format rules,” choose Custom formula is.
  4. Enter this formula:
    =LEN(B2)=ARRAYFORMULA(COUNTA(UNIQUE(MID(B2, SEQUENCE(LEN(B2)), 1))))
  5. Set your formatting style.
  6. Click Done.
Example of Highlighting Unique Digit Numbers in Google Sheets

Now, all numbers with unique digits in the selected range will be highlighted!

If you’d like to explore more ways to highlight and analyze data using conditional formatting, check out The Ultimate Guide to Conditional Formatting in Google Sheets, where all related tutorials are organized in one place.

Resources – Other Interesting Google Sheets Tips

Prashanth K V
Prashanth K V
Your Trusted Google Sheets and Excel Expert Prashanth K V is a Diamond Product Expert in Google Sheets, officially recognized by Google for his contributions to the Docs Editors Help Community and featured in the Google Product Experts Directory. Explore his blog to learn advanced formulas, automation tips, and problem-solving techniques to elevate your spreadsheet skills.

Top Discussions

More like this

How to Build a Road Trip Fuel Cost Splitter Formula in Google Sheets

Need a fair formula to split fuel costs among travelers on a long road...

Road Trip Fuel Cost Splitter in Google Sheets (Free Template)

When you go on a long road trip with friends, splitting fuel expenses fairly...

Savings Tracker Template in Google Sheets (Free Download)

Managing multiple savings goals can become difficult without a proper system to track your...

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.