Check if a list has duplicate numbers [Quick tip]

Share

Facebook
Twitter
LinkedIn

A while ago (well more than 3 years ago), I wrote about an array formula based technique to check if a list of values have any duplicates in them.

Today, lets learn a simpler formula to check if a list has duplicate numbers.

Assuming you have some numbers in a range B4:B10 as shown below,

Check if a list has duplicate numbers using Excel - How to?

You can use COUNTIF & MODE formulas to check if the list has any duplicates, like this:

=IF(COUNTIF($B$4:$B$10,MODE($B$4:$B$10))>1, "List has duplicates", "No duplicates")

How does it work?
MODE formula gives us the most frequently occurring number in a list. Then, we use COUNTIF to see how many times this number occurs in a list.
In a list with no duplicates mode value occurs only 1 time. If a list has duplicate numbers, then count of mode would be more than 1. That is what the IF formula checks for and then prints appropriate message.

See this example:

[Embedded Excel, if you can not see it, click here]

Play with below embedded Excel file to understand the technique. You can modify numbers or formula.

Or Download this Example

Click here to download the example workbook and play with it.

How do you check if a list has duplicates?

For text values, I use the array formula technique described here. For numeric values, I prefer MODE + COUNTIF combination because it is easy to write & explain.

What about you? How do you check if a list has duplicates? Which formulas do you use? Please share your techniques using comments.

More on Duplicates & Unique values

If we analyze the time an analyst spends on various things, we would realize,

  • 30% of time cleaning data (removing duplicates etc.)
  • 30% of time actual analysis
  • 30% of time drinking coffee
  • 10% of time actual presentation

On a more serious note, if you want to learn various techniques to deal with duplicate values, read on:

Facebook
Twitter
LinkedIn

Share this tip with your colleagues

Excel and Power BI tips - Chandoo.org Newsletter

Get FREE Excel + Power BI Tips

Simple, fun and useful emails, once per week.

Learn & be awesome.

Welcome to Chandoo.org

Thank you so much for visiting. My aim is to make you awesome in Excel & Power BI. I do this by sharing videos, tips, examples and downloads on this website. There are more than 1,000 pages with all things Excel, Power BI, Dashboards & VBA here. Go ahead and spend few minutes to be AWESOME.

Read my storyFREE Excel tips book

Overall I learned a lot and I thought you did a great job of explaining how to do things. This will definitely elevate my reporting in the future.
Rebekah S
Reporting Analyst
Excel formula list - 100+ examples and howto guide for you

From simple to complex, there is a formula for every occasion. Check out the list now.

Calendars, invoices, trackers and much more. All free, fun and fantastic.

Advanced Pivot Table tricks

Power Query, Data model, DAX, Filters, Slicers, Conditional formats and beautiful charts. It's all here.

Still on fence about Power BI? In this getting started guide, learn what is Power BI, how to get it and how to create your first report from scratch.

5 Responses to “Show more of your workbook on screens [quick tip]”

  1. Bda75 says:

    In 2013 you can also add to the QAT the hidden command "Toggle Full Screen View".

  2. Chris Newman says:

    Instead of using the shortcut CTRL+F1, I prefer just to double-click one of the tab names (ie double-click the "Home" text on the Home tab) to enable the Ribbon Outline view. To return to the normal Ribbon state, just double-click your mouse again!

  3. liu says:

    press Ctrl+Shift+F1, you will get a full screen

  4. efand says:

    Instead of Ctrl + F1, I use Ctrl + Shift + F1 (Excel 2016)

  5. Jay says:

    Alt W E sequence for full screen
    ESC to get back

Leave a Reply