FormulaCraft

How to sum unique values in Excel and Google Sheets

Topic:SUM & aggregation
Excel & Google Sheets
=SUMPRODUCT(B2:B6/COUNTIF(B2:B6,B2:B6))

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

Step by step

  1. 1Place the numeric values in column B (B2:B6). Duplicate values represent entries you want counted only once.
  2. 2Enter =SUMPRODUCT(B2:B6/COUNTIF(B2:B6,B2:B6)). For each row, B divides by the frequency of that value in the range, so duplicates share the contribution.
  3. 3Press Enter. The result equals the sum of each unique value taken once.

Tips

Need it for your exact data?

Describe your columns in plain English and get the precise formula for your sheet, with the right Excel or Sheets syntax.

Frequently asked

What exactly does 'sum unique values' mean — summing deduplicated amounts or summing amounts that appear only once?

This tutorial sums each distinct value once (deduplicated sum). If you want only values that appear exactly once, filter with COUNTIF=1: =SUMPRODUCT((COUNTIF(B2:B6,B2:B6)=1)*B2:B6).

Can I do this with text labels instead of numbers?

Counting unique text labels is done with SUMPRODUCT(1/COUNTIF(range,range)) which returns the count of distinct values, not a sum of numbers.

More on SUM & aggregation

See all →

Formulas used

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: