Tom Enns
Tom Enns

Reputation: 182

How to number the occurrences of a particular value in multiple cells

I have a table that represents the purchases of a list of customers by date. The data is sorted in order by customer, and purchase date.

I need to place the total number of orders a particular customer has made in a third column (probably by checking the number of previous instances of the customer's name).

My table currently looks like this:

   Column A   Column B   Column C
1  12/03/13   Angela     
2  01/05/14   Angela
3  03/07/14   Angela
4  04/01/14   Angela
5  03/06/13   Ben
6  04/02/13   Ben
7  11/11/15   Carl
8  12/11/15   Carl
9  01/01/16   Carl
10 02/03/17   David
11 04/04/17   Ethan

And what I need to see is (where Column C is the Total Orders for that customer)

  Column A   Column B   Column C
1  12/03/13   Angela       1  
2  01/05/14   Angela       2
3  03/07/14   Angela       3
4  04/01/14   Angela       4
5  03/06/13   Ben          1
6  04/02/13   Ben          2
7  11/11/15   Carl         1
8  12/11/15   Carl         2
9  01/01/16   Carl         3
10 02/03/17   David        1
11 04/04/17   Ethan        1

Any help is greatly appreciated!

Upvotes: 0

Views: 41

Answers (1)

QHarr
QHarr

Reputation: 84465

Try the following in C2

 =COUNTIF($B$2:$B2,$B2)

Drag down for as many rows as required.

Data

Upvotes: 1

Related Questions