ExcelReady
CourseMock testsFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before day one. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Mock tests
  • Function guides
  • Blog

Test prep

  • Excel level test
  • Excel test practice
  • Free screening quiz
  • Certificate

Company

  • About
  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Dynamic arrays
  3. How to Sum Unique Values in Excel With UNIQUE

How to Sum Unique Values in Excel With UNIQUE

By ExcelReady Team·Updated November 3, 2026·6 min read

The short answer

To sum unique values in Excel 2021 or Microsoft 365, use =SUM(UNIQUE(A2:A9)): UNIQUE removes repeats and SUM adds what is left. To add values that appear exactly once, use =SUM(UNIQUE(A2:A9,,TRUE)). In older Excel, =SUMPRODUCT(A2:A9/COUNTIF(A2:A9,A2:A9)) gives the same result as SUM of UNIQUE.

Key takeaways

  • =SUM(UNIQUE(range)) adds each different value once. It needs Excel 2021, Excel 2024 or Microsoft 365.
  • =SUM(UNIQUE(range,,TRUE)) adds only the values that appear exactly once.
  • To count each record once, dedupe by its ID, not its amount: =SUM(INDEX(UNIQUE(A2:B7),,2)).
  • In older Excel, =SUMPRODUCT(range/COUNTIF(range,range)) sums distinct values without UNIQUE.
On this page+
  1. Which "unique" do you mean?
  2. How to sum distinct values with SUM and UNIQUE
  3. How to sum values that appear only once
  4. How to sum each record once, not each amount
  5. How to sum unique values in older Excel
  6. How to total by each unique item
  7. Sum unique values with a condition
  8. Common problems
  9. Practise it

To sum unique values in Excel, wrap UNIQUE inside SUM: =SUM(UNIQUE(A2:A9)). UNIQUE removes the repeats and SUM adds what's left. But "unique" can mean three different things: each different value once, only the values that never repeat, or each record once. This guide shows the right formula for each, plus a version for older Excel. It's for anyone cleaning up duplicate exports or answering a "total without duplicates" question in a job test.

Which "unique" do you mean?#

Before you write the formula, decide which total you need. Here is a list of fees in A2:A9:

A
1Fee
240
325
440
515
625
760
840
910
You wantFormulaResult
Every value (normal total)=SUM(A2:A9)255
Each different value once (distinct)=SUM(UNIQUE(A2:A9))150
Only values that appear once=SUM(UNIQUE(A2:A9,,TRUE))85

Distinct values are 40, 25, 15, 60 and 10, which add up to 150. Values that appear exactly once are 15, 60 and 10, which add up to 85. Both are "unique", so check which one the question means.

How to sum distinct values with SUM and UNIQUE#

UNIQUE returns each different value once, and SUM adds them. In an empty cell, type:

Excel formula
=SUM(UNIQUE(A2:A9))

The result is 150. On its own, =UNIQUE(A2:A9) would spill the five distinct values down the column. Inside SUM, nothing spills: SUM adds the list in memory and returns one number.

UNIQUE needs Excel 2021, Excel 2024 or Microsoft 365. In older versions it shows #NAME?; use the SUMPRODUCT method further down. The UNIQUE function guide and the SUM function guide cover both functions in detail.

How to sum values that appear only once#

UNIQUE has a third argument, exactly_once. Set it to TRUE and UNIQUE keeps only values that occur a single time:

Excel formula
=SUM(UNIQUE(A2:A9,,TRUE))

The two commas skip the second argument (by_col), which you only need for data laid out across columns. The result is 85: 40 and 25 repeat, so they are left out completely.

How to sum each record once, not each amount#

Real duplicates are usually whole rows, such as an invoice exported twice. Here, deduping the amounts alone gives the wrong answer:

AB
1InvoiceAmount
2INV-101250
3INV-102400
4INV-101250
5INV-103400
6INV-104150
7INV-102400

=SUM(UNIQUE(B2:B7)) returns 800, because INV-102 and INV-103 both have an amount of 400, and UNIQUE keeps only one 400. That loses a real invoice.

Instead, run UNIQUE on the ID and amount together, then add the amount column:

Excel formula
=SUM(INDEX(UNIQUE(A2:B7),,2))
  1. UNIQUE(A2:B7) keeps each row once: four invoices.
  2. INDEX(...,,2) takes column 2 of that result, the amounts. Leaving the row number empty means "all rows".
  3. SUM adds them: 250 + 400 + 400 + 150 = 1,200.

In Microsoft 365, CHOOSECOLS(UNIQUE(A2:B7),2) does the same as the INDEX part. If one invoice ID appears with two different amounts, UNIQUE keeps both rows, so check those by hand. To dedupe across several columns, see the guide to UNIQUE across multiple columns.

How to sum unique values in older Excel#

Without UNIQUE, use SUMPRODUCT with COUNTIF:

Excel formula
=SUMPRODUCT(A2:A9/COUNTIF(A2:A9,A2:A9))

COUNTIF(A2:A9,A2:A9) returns how many times each value appears: 3 for each 40, 2 for each 25, and so on. Dividing each value by its count splits it into equal shares. The three 40s each become 40 ÷ 3, which add back up to one 40. The result is 150, the same as SUM of UNIQUE.

For the invoice table, count the IDs instead of the amounts:

Excel formula
=SUMPRODUCT(B2:B7/COUNTIF(A2:A7,A2:A7))

That also returns 1,200. If the range has blank cells, COUNTIF counts them as 0 and the formula shows #DIV/0!. This version skips blanks: =SUMPRODUCT((A2:A9<>"")*A2:A9/COUNTIF(A2:A9,A2:A9&"")).

How to total by each unique item#

Sometimes "sum unique" means a total per item: sales per region, hours per person. Combine UNIQUE with SUMIF. If A2:A20 holds regions and B2:B20 holds sales:

  1. In D2, type =UNIQUE(A2:A20) to spill the list of regions.
  2. In E2, type =SUMIF(A2:A20,D2#,B2:B20).

The # after D2 means "the whole spilled list", so E2 spills one total per region and grows when a new region appears. To sort the list too, see how to make a sorted unique list. A pivot table gives the same totals, but it adds every row, so remove duplicate rows first.

Sum unique values with a condition#

Add FILTER to keep only the rows you want before UNIQUE removes duplicates. To total each paid invoice once, with the status in C2:C7:

Excel formula
=SUM(INDEX(UNIQUE(FILTER(A2:B7,C2:C7="Paid")),,2))

FILTER keeps the paid rows, UNIQUE drops repeated invoices, and SUM adds the amounts. The guide to FILTER with SUM explains the FILTER part, and counting unique values with criteria uses the same pattern with COUNTA. If no rows match, FILTER returns #CALC!; add a third argument such as 0 to avoid it.

Common problems#

  • Numbers stored as text. UNIQUE treats the number 40 and the text "40" as different values, and SUM ignores the text one. Convert the column to numbers first.
  • Extra spaces. "INV-101 " with a trailing space is a different ID from "INV-101". Clean IDs with TRIM.
  • Wrong kind of unique. Check whether you need distinct values, once-only values or unique records. The results differ.
  • #NAME? in older Excel. UNIQUE isn't available before Excel 2021. Use SUMPRODUCT and COUNTIF instead.

Practise it#

Summing unique values is two skills joined: getting the distinct list and adding it up. Practise UNIQUE in a live spreadsheet to list and count distinct values, then practise SUM and AutoSum to total ranges quickly. Each lesson checks your formula as you type. Then try the exercise on this page to total the duplicated invoices only once.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

Some invoices were exported twice. In E2, total each invoice only once: run UNIQUE on A2:B7 (ID and amount together), take column 2 with INDEX, and wrap it in SUM.

fx
ABCDEF
1
Invoice
Amount
2
INV-101
250
Total once
3
INV-102
400
4
INV-101
250
5
INV-103
400
6
INV-104
150
7
INV-102
400
8
9
10

Tip: UNIQUE(A2:B7) keeps each invoice row once. INDEX(...,,2) takes its second column. SUM adds it.

Practise this in a lesson

LessonUNIQUE: list and count distinct valuesPull a clean list of distinct regions or customers with UNIQUE, then count them with COUNTA.LessonSUM and AutoSumAdd up a column of numbers with SUM, then let AutoSum write the formula for you.Function guideUNIQUEList distinct values with Excel's UNIQUE, count them with COUNTA, or find items that appear only once. Examples plus a live exercise.Function guideSUMAdd up columns, rows and separate ranges with Excel's SUM function. Clear examples, common mistakes and a live practice exercise.

Frequently asked questions

How do I sum only unique values in Excel?

+

In Excel 2021 or Microsoft 365, type =SUM(UNIQUE(A2:A9)). UNIQUE returns each different value once and SUM adds them. In older versions, use =SUMPRODUCT(A2:A9/COUNTIF(A2:A9,A2:A9)).

How do I sum values that appear only once?

+

Set the third argument of UNIQUE to TRUE: =SUM(UNIQUE(A2:A9,,TRUE)). That keeps only values that occur exactly once, so any value that repeats is left out completely.

How do I sum amounts without counting duplicate rows?

+

Run UNIQUE on the ID and amount columns together, then add the amount column: =SUM(INDEX(UNIQUE(A2:B7),,2)). This counts each invoice once even when two different invoices share the same amount.

Why does my SUMPRODUCT COUNTIF formula return #DIV/0!?

+

The range contains blank cells. COUNTIF counts a blank as 0, so the division fails. Use =SUMPRODUCT((A2:A9<>"")*A2:A9/COUNTIF(A2:A9,A2:A9&"")) to skip blanks.

Can I sum unique values with a pivot table?

+

A pivot table can total by each unique item, but it adds every row, so duplicate rows are still counted. Remove the duplicates first, or use a formula with UNIQUE.

Sources

  • UNIQUE function - Microsoft Support
  • SUM function - Microsoft Support
  • SUMPRODUCT function - Microsoft Support

Written and checked by the ExcelReady Team. First published November 3, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. Which "unique" do you mean?
  2. How to sum distinct values with SUM and UNIQUE
  3. How to sum values that appear only once
  4. How to sum each record once, not each amount
  5. How to sum unique values in older Excel
  6. How to total by each unique item
  7. Sum unique values with a condition
  8. Common problems
  9. Practise it

Keep reading

Dynamic arrays· 7 min read

Get Unique Values From Multiple Columns in Excel

To get unique values from multiple columns in Excel, turn the columns into one list with TOCOL, then pass it to UNIQUE: =UNIQUE(TOCOL(A2:C5,1)). The 1 skips blank cells. Wrap it in SORT for an A to Z list. TOCOL needs Microsoft 365 or Excel 2024. In older versions, stack the columns into one and use Remove Duplicates.

Dynamic arrays· 6 min read

Make a Sorted List of Unique Values in Excel

To make a unique sorted list in Excel, wrap UNIQUE inside SORT: =SORT(UNIQUE(B2:B9)). UNIQUE removes the repeats and SORT puts what is left in A to Z order. The list spills down and updates when the data changes. Use =SORT(UNIQUE(B2:B9),,-1) for Z to A. Both functions need Excel 2021, Excel 2024 or Microsoft 365.

Dynamic arrays· 6 min read

Sum, Count or Average FILTER Results in Excel

To sum FILTER results in Excel, put FILTER inside SUM: =SUM(FILTER(D2:D9,B2:B9="East")) adds the sales of East rows only. Swap SUM for COUNT, AVERAGE or MAX for other answers. Add 0 as FILTER's third argument so no matches return 0 instead of #CALC!. To total rows left visible by the filter buttons, use =SUBTOTAL(109,D2:D9).

More on dynamic arrays

  • TAKE Function in Excel (and DROP): First or Last N Rows
  • Excel TOCOL Function: Turn a Grid Into One Column
  • Make a Top 5 List With SORT and FILTER
  • TRANSPOSE in Excel: Flip Rows and Columns
  • TRIMRANGE Function in Excel: Drop Empty Rows From a Range
  • The UNIQUE Function in Excel
All dynamic arrays articles →

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback, right in your browser. Nothing to download.

Start learning for free