Count unique values among duplicates (2024)

Skip to main content

Microsoft

Support

Support

Sign in

Sign in with Microsoft

Sign in or create an account.

Hello,

Select a different account.

You have multiple accounts

Choose the account you want to sign in with.

Excel

Formulas and functions

Errors

Errors

Count unique values among duplicates

Excel for Microsoft 365 Excel for Microsoft 365 for Mac Excel for the web Excel 2021 Excel 2021 for Mac Excel 2019 Excel 2019 for Mac Excel 2016 More...Less

Let's say you want to find out how many unique values exist in a range that contains duplicate values. For example, if a column contains:

  • The values 5, 6, 7, and 6, the result is three unique values— 5 , 6 and 7.

  • The values "Bradley", "Doyle", "Doyle", "Doyle", the result is two unique values— "Bradley" and "Doyle".

There are several ways to count unique values among duplicates.

You can use the Advanced Filter dialog box to extract the unique values from a column of data and paste them to a new location. Then you can use the ROWS function to count the number of items in the new range.

  1. Select the range of cells, or make sure the active cell is in a table.

    Make sure the range of cells has a column heading.

  2. On the Data tab, in the Sort & Filter group, selectAdvanced.

    The Advanced Filter dialog box appears.

  3. SelectCopy to another location.

  4. In the Copy to box, enter a cell reference.

    Alternatively, selectCollapse Dialog Count unique values among duplicates (2) to temporarily hide the dialog box, select a cell on the worksheet, and then press Expand Dialog Count unique values among duplicates (3).

  5. Select the Unique records only check box, and selectOK.

    The unique values from the selected range are copied to the new location beginning with the cell you specified in the Copy to box.

  6. In the blank cell below the last cell in the range, enter the ROWS function. Use the range of unique values that you just copied as the argument, excluding the column heading. For example, if the range of unique values is B2:B45, you enter =ROWS(B2:B45).

Use a combination of the IF, SUM, FREQUENCY, MATCH, and LEN functions to do this task:

  • Assign a value of 1 to each true condition by using the IF function.

  • Add the total by using the SUM function.

  • Count the number of unique values by using the FREQUENCY function. The FREQUENCY function ignores text and zero values. For the first occurrence of a specific value, this function returns a number equal to the number of occurrences of that value. For each occurrence of that same value after the first, this function returns a zero.

  • Return the position of a text value in a range by using the MATCH function. This value returned is then used as an argument to the FREQUENCY function so that the corresponding text values can be evaluated.

  • Find blank cells by using the LEN function. Blank cells have a length of 0.

Count unique values among duplicates (4)

Notes:

  • The formulas in this example must be entered as array formulas. If you have a current version of Microsoft 365, then you can simply enter the formula in the top-left-cell of the output range, then press ENTER to confirm the formula as a dynamic array formula. Otherwise, the formula must be entered as a legacy array formula by first selecting the output range, entering the formula in the top-left-cell of the output range, and then pressing CTRL+SHIFT+ENTER to confirm it. Excel inserts curly brackets at the beginning and end of the formula for you. For more information on array formulas, see Guidelines and examples of array formulas.

  • To see a function evaluated step by step, select the cell containing the formula, and then on the Formulas tab, in the Formula Auditing group, selectEvaluate Formula.

  • The FREQUENCY function calculates how often values occur within a range of values, and then returns a vertical array of numbers. For example, use FREQUENCY to count the number of test scores that fall within ranges of scores. Because this function returns an array, it must be entered as an array formula.

  • The MATCH function searches for a specified item in a range of cells, and then returns the relative position of that item in the range. For example, if the range A1:A3 contains the values 5, 25, and 38, the formula =MATCH(25,A1:A3,0) returns the number 2, because 25 is the second item in the range.

  • The LEN function returns the number of characters in a text string.

  • The SUM function adds all the numbers that you specify as arguments. Each argument can be a range, a cell reference, an array, a constant, a formula, or the result from another function. For example, SUM(A1:A5) adds all the numbers that are contained in cells A1 through A5.

  • The IF function returns one value if a condition you specify evaluates to TRUE, and another value if that condition evaluates to FALSE.

Need more help?

You can always ask an expert in the Excel Tech Communityor get support inCommunities.

See Also

Filter for unique values or remove duplicate values

Need more help?

Want more options?

Discover Community

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Count unique values among duplicates (5)

Microsoft 365 subscription benefits

Count unique values among duplicates (6)

Microsoft 365 training

Count unique values among duplicates (7)

Microsoft security

Count unique values among duplicates (8)

Accessibility center

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

Count unique values among duplicates (9)

Ask the Microsoft Community

Count unique values among duplicates (10)

Microsoft Tech Community

Thank you for your feedback!

×

Count unique values among duplicates (2024)
Top Articles
How safe is your smart home? Home security tips for the 21st century.
A slice of frugal dividends from the United states
4223 Macalester Street
Torin Kamran Charles Cox
Ubg365
Uworld Cost
Virtual Prepaid Minutes
Moxfield Deck Builder
477 Job Calls
Happy Ending Massage Milwaukee
R&B Music Near Me Tonight
Molly-Mae Hague splits from Tommy Fury after five years together
Ucf Net Price Calculator
Mommy Countdown Calendar™ with Pregnancy Gifts
Rose Tree Park Italian Festival 2023
Safety Jackpot Login
Search results for Kid gets mutilated by machete
Cognitive Function Test Potomac Falls
Mugshots Key West
Blazing Crystal Kh3
Oscoda Michigan Map: Discover the Charm and Beauty of This Scenic Destination - 200smichigan.com (UPDATE 👍)
Www Dermpathdiagnostics.com/Pay-Invoice
Huntington Bank Overnight Payoff Address
Immersive Gamebox Deep Ellum Reviews
Desert Cabinet Odds And Ends
Rent A Stump Grinder Menards
8er Reihe Einmaleins - Kostenlose Arbeitsblätter
18 Cafes in Yoyogi that You'll Want to Visit Repeatedly
Drexel Student Doctor Network
Retribution Paladin DPS Spec, Builds, and Talents - The War Within (Season 1)
Kentucky Lottery Remaining Prizes
Vinnie Politan Weight Loss - What Causes Rapid Weight Loss In Cats
Splunk Stats Count By Hour
Waters Funeral Home | Baldwyn, MS Funeral Home & Cremation
Conan Exiles Change Horse Color
Lubbock Avalanche Journal Newspaper Obituaries
Google Sites Among Us
Remax Mls
10 War Movies That Angered Military Experts and Veterans
Craigslist Murfreesboro Pets
Albertville Memorial Funeral Home Obituaries
2013 Nissan Rogue Lug Nut Torque
Tyss Osrs
Fx Channel On Optimum
Terrier Hockey Blog
Ter Review
Marvel Medical Staffing hiring Travel Nurse RN - ICU/Critical Care in Ottumwa, IA in Ottumwa, IA | LinkedIn
Restored Republic Jan 3 2023
March 2023 Wincalendar
Catsweb Tx State
Craigslist Cars Lima Ohio
Latest Posts
Article information

Author: Pres. Lawanda Wiegand

Last Updated:

Views: 5903

Rating: 4 / 5 (71 voted)

Reviews: 94% of readers found this page helpful

Author information

Name: Pres. Lawanda Wiegand

Birthday: 1993-01-10

Address: Suite 391 6963 Ullrich Shore, Bellefort, WI 01350-7893

Phone: +6806610432415

Job: Dynamic Manufacturing Assistant

Hobby: amateur radio, Taekwondo, Wood carving, Parkour, Skateboarding, Running, Rafting

Introduction: My name is Pres. Lawanda Wiegand, I am a inquisitive, helpful, glamorous, cheerful, open, clever, innocent person who loves writing and wants to share my knowledge and understanding with you.