The value to count is entered in cell E5, which is thenamed rangevalue.

The formula above works well when you want tosinglecount for one value in a range.

However, to get arunning count, we’ll need to adapt the formula to use anexpanding range.

Basic example of running count of “blue” values

This is a special kind of “mixed reference”, since it contains both absolute and relative addresses.

Because the first reference, $B$5, is locked, it doesn’t change.

However the second reference, B5, changes when the formula is copied.

Basic example of running count of “blue” values

The result is anexpanding range.

However, the count only increments when another “blue” value is encountered.

Notice we have now swapped the hardcoded value “blue” with the named rangevalue(E5).

Basic example of running count of “blue” values

The named range is simply for convenience.

It automatically acts like an absolute reference, and it makes the formula easier to read and write.

This effectively removes the count for all other values.

Basic example of running count of “blue” values

The final result is a running count for cells that contain “blue”.

If we select a different value, the running count formula immediately returns a new set of running counts.

FALSE values evaluate as zero and do not affect the count.

Basic example of running count of “blue” values

The numbers incountsassociated with TRUE in hits pass through unaffected.

The numbers associated with FALSE are replaced with empty strings.

More than one condition can be tested by nesting IF functions.

Result of selecting a different value to count

The IF…

LET Function

The Excel LET function lets you define named variables in a formula.

SCAN can be used to generate running totals, running counts, and other calculations…

Excel formula: Count cells that contain specific text

Excel formula: Calculate running total

Excel COUNTIF function

Excel IF function

Excel LET function

Excel SCAN function

Basic example of running count of “blue” values

Result of selecting a different value to count