Excel COUNT How Many Times a Value Appears

This guide treats “excel count how many times a value appears” the way busy spreadsheet users actually want it: answer first, a live tool to prove it on your own data, then the reasoning. It is written for Excel but calls out every place Google Sheets differs, and the platform toggle at the top switches all shortcuts between Windows and Mac so nothing here assumes the keyboard you are not on.

Exact answer

In Excel: use =COUNTIF(A:A,A2) for how many times each value repeats; count distinct values with =SUMPRODUCT(1/COUNTIF(rng,rng)) or =ROWS(UNIQUE(rng)) in Microsoft 365.

ƒxDuplicate RemoverLive
Unique values
3

2 duplicates removed · 3 kept

Runs entirely in your browser — your data never leaves this page.
=COUNTIF(A:A,A2)
Ctrl+CthenCtrl+Shift+V+Cthen+Ctrl+VPaste values · WindowsMac

Need it as an auditable file?

Ships inside the linked template — formula-driven, unlocked, audit-ready.

View template

What this does

Counting duplicates is really two questions. To see how often each value occurs, COUNTIF(A:A,A2) returns the frequency for that row — 1 means it is unique, anything higher means it repeats. To count how many distinct values a list contains, the classic =SUMPRODUCT(1/COUNTIF(range,range)) adds a fraction for each cell so every group of identical values sums to exactly 1; in Microsoft 365 the simpler =ROWS(UNIQUE(range)) does the same job. Most people learn this as a sequence of clicks and forget it by next week; learning it as a pattern instead is what lets you apply it to the next, slightly different version of the problem without starting from scratch. That is the difference this page is trying to make. For “excel count how many times a value appears”, the reliable version is a short checking loop, not just the first command that appears to work. Run it on a deliberately small range first, watch how the affected cells change, and only then apply the same setup to the full sheet. When a formula is involved, keep the inputs labelled beside it, reference cells instead of typing values, and apply number formatting only after the result checks out. That is what makes a calculation you can defend to a CFO or an auditor useful in real work: repeatable, auditable, and not dependent on memory or luck.

A worked example

A column A2:A9 of fruit reads Apple, Pear, Apple, Plum, Apple, Pear, Kiwi, Plum. Put =COUNTIF(A:A,A2) beside it: Apple shows 3, Pear shows 2, Plum shows 2, Kiwi shows 1. To count the distinct fruits, =SUMPRODUCT(1/COUNTIF(A2:A9,A2:A9)) returns 4 (Apple, Pear, Plum, Kiwi), and =ROWS(UNIQUE(A2:A9)) returns the same 4 in 365. Counting duplicates answers the questions a flag cannot: how concentrated is the data, how many real customers are in a list of 5,000 rows, which value repeats most. It is the measurement step between spotting duplicates and deciding what to do about them. If there is any chance you will reuse this, drop it into a small template tab right now: a labelled input area on the left and the formula beside it, checked once against the tool above. Next time the same question comes up, the answer is a single paste away instead of a rebuild from memory.

In Google Sheets

Google Sheets handles this almost identically to Excel. The formula syntax above is the same, and the menu lives under a slightly different label rather than a ribbon tab. Use the platform toggle at the top of the page to switch every keyboard shortcut between Windows and Mac, and expect at most cosmetic differences in naming. The aim was to get you unstuck fast and leave you a little more capable than a copy-paste would. The answer is at the top, the tool proves it, and the detail above shows why it holds — so the next time a colleague asks, you can answer without reaching for search. Treat “excel count how many times a value appears” as a small building block rather than a chore. Once the inputs sit in their own cells and the formula reads from them, the same setup answers a dozen related questions with a tweak, and Excel keeps every dependent figure current as the data changes. The tool above is there so you can rehearse and verify before committing anything to a real workbook; the steps and worked example are there so the logic sticks. Get it right once and it stops costing you time — it starts saving it, every time the question comes back around.

Common mistakes

  • Using a whole column (A:A) inside SUMPRODUCT(1/COUNTIF(...)) — the empty cells divide by zero and throw #DIV/0!; pin it to the exact range.
  • Confusing the two answers: COUNTIF gives a per-row frequency, not the number of distinct values.
  • Forgetting that COUNTIF is case-insensitive, so "apple" and "Apple" count as the same value.
  • Letting blank cells into the distinct-count range, which the 1/COUNTIF trick cannot divide.

Frequently asked questions

How do I count how many values are duplicated?

Count distinct repeats with =SUMPRODUCT((COUNTIF(rng,rng)>1)/COUNTIF(rng,rng)); it returns how many values appear more than once, each counted once.

Why does SUMPRODUCT(1/COUNTIF()) count uniques?

Each value contributes 1/(its count), so a value appearing three times contributes 1/3 three times = 1. Summed, every distinct value adds exactly 1.

Is there a COUNTUNIQUE function?

Google Sheets has =COUNTUNIQUE(range); Excel uses =COUNTA(UNIQUE(range)) in 365 or the SUMPRODUCT formula in older versions.

Other ways people ask this

People reach this page typing “how to count how many cells filled in excel”, “count time excel”, “time value calculator excel” and “excel how many times a value appears in a column”, among other phrasings; whichever wording you used, the fix above is the one you want.

Why do people search for this in so many different ways?

Because the same task has many names. “how to count how many cells filled in excel”, “count time excel”, “time value calculator excel” all point at the one operation explained on this page, which is why they all lead here.