Skip to main content
 

How to count the number of unique rows (combinations of multiple columns) in Excel?

Author: Kelly Last Modified: 2024-08-07

You may be familiar with counting the unique cells in one column in Excel. However, do you have any idea to quickly count the number of unique rows, or the number of unique combinations of multiple columns in Excel? There are a couple of easy solutions:

Count the number of unique row/combinations of multiple columns with formulas

Count the number of unique row/combinations of multiple columns with Kutools for Excel


Count the number of unique rows/combinations of multiple columns with formulas

This method will introduce two formulas to count the total number of unique rows or combinations of multiple columns with following steps.

1. Select a blank cell besides the columns you will count unique rows, says Cell E2, type the formula =A2&B2&C2 into it, and then drag the cell’s AutoFill Handle down to the range as you need.

Note: In above formula, A2 is the first data of the first column, B2 is the first data of the second column, and C2 is the first data of the third column. For combining another column, such as another Column D, change the formula to =A2&B2&C2&D2.

And then you will see columns are combined into one. See screenshot:

a screenshot showing how to use the formula and the final results

2. Select a blank cell you will place the total number of unique rows at, and type the formula =SUM(1/COUNTIF(E2:E20,E2:E20)) (E2:E20 is the new combination column we got in the first step) into it, and then press the Ctrl + Shift+ Enter keys simultaneously. See screenshot:

a screenshot of using the SUM and COUNTIF formula

And then the total number of all unique rows or combinations of multiple columns will return into the selected cell. See screenshot:

a screenshot of the final result


Count the number of unique row/combinations of multiple columns with Kutools for Excel

If you have Kutools for Excel installed, you can apply its Select Duplicate & Unique Cells utility to quickly count the unique row or combinations of multiple columns at ease.

Kutools for Excel - Packed with over 300 essential tools for Excel. Enjoy a full-featured 30-day FREE trial with no credit card required! Download now!

1. Select the columns (ignoring the column header as you need) you will count the unique rows, and click Kutools > Select > Select Duplicate & Unique Cells. See screenshot:

2. In the opening Select Duplicate & Unique Cells dialog box, check the Unique values only option or All unique (Including 1st duplicates) option as you need in the Rule section, and then click the Ok button. See screenshot:

a screenshot of setting the Select Duplicate & Unique Cells dialog box

If you select the All unique (Including 1st duplicates) option, a dialog box will pop out and show how many unique rows including the 1st duplicate rows have been selected as below screenshot shown:

a screenshot showing how many unique rows including the first are selected

If you select the Unique values only option, a dialog box will pop out and show how many unique rows have been selected as below screenshot shown:

a screenshot showing how many unique rows are selected

3. Click the OK button to close the dialog box.

Kutools for Excel - Supercharge Excel with over 300 essential tools. Enjoy a full-featured 30-day FREE trial with no credit card required! Get It Now


Related articles:


Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!