UNIQUEIF Excel Formula

I recently had an interesting question in a webinar. Could I create a formula like UNIQUEIF. I like a challenge so here is my answer.

The exact question is below.

Q: Is there an easy way to run the equivalent of what would be a UNIQUEIF function? That is, to return any unique items from a Column, but only where they meet a specified criterion?

Solution

In the image below we have a list of states with duplicates. Some are 2 digits and some are 3. The standard UNIQUE function removes duplicates.

The solution involves using the FILTER function to apply the condition and then the UNIQUE function removes duplicates from the FILTER output.

In this case we only want unique states with 2 characters.

The FILTER function can also handle if the condition is based on another column.

In the example dataset below we want to extract the unique invoice numbers for a particular state.

This is a flexible solution – changing cell S1 will change the state being filtered.

The FILTER function is flexible and can handle more than one condition. In the example below we list the WA invoices with an orange product.

The FILTER function offers many solutions when you need to apply conditions in a dynamic array formula.

This Post Has 2 Comments

  1. Whitney Sanders

    This is such a clever and elegant solution! I love how you combined the power of `FILTER` and `UNIQUE` to create a “virtual” `UNIQUEIF` function — it’s simple, flexible, and avoids the need for complex array formulas or helper columns. Your explanation makes it so easy to follow, especially for those looking to refine their Excel problem-solving skills. A great example of how modern Excel functions can work together to do more with less!

    1. Neale Blackwood

      Hi Whitney
      Glad you like it. FILTER Offers lot of solutions.
      Thanks for commenting.
      Regards
      Neale

Leave a Reply

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