For example, total counts by category, color, size, status, etc.
TheCOUNTIF functionis a good way to generate these kinds of totals.
Also included below are links to a pivot table option and a dynamic array formula option.
Both of these alternatives can automatically extract the values to count and generate the counts at the same time.
COUNTIF function
TheCOUNTIF functiontakes two arguments: arangeof cells to count, and thecriteriato use for counting.
The formula in cell F5 is:
wherecoloris anamed rangefor cells C5:C16.
We can simply use the value in cell E5 directly forcriteria.
By default, named ranges behave like absolute references and do not change when copied.
This means the reference tocolordoes not change, while the reference to E5 isrelativeand changes at each new row.
Like a pivot table, a dynamic formula will automatically expand to include new data.
Unlike a pivot table, formulas recalculate automatically and do not need to be refreshed.