This means the first occurrence of a customer is 1, the second is 2, and so on.
Finally, to force a 1 or 0 result, we add zero.
The math operation causes Excel to coerce TRUE and FALSE to equivalent numbers, 1 and 0.
Note: The example above uses first name for customer id.
This is not realistic, but it makes it easy for the human eye to track.
In normal data, customer id will be a unique number of some kind.
COUNTIF can be used to count cells that…