# Count how many months sales were made

#### Godders199

##### Active Member
Hello, struggling to find where to start on this one... I have a spreadsheet column a is sales persons name, column b is sales date. On sheet 2 is a list of the active sales people.
I need to find for each sales person on sheet2 how many months of the year they made a sale. For example life salesperson A , made 10 sales in January and 2 in March and 1 in May. I need to return the answer 3 in column b on sheet 2

i found code that removes all but the first entry each month for each sales person, but I need to keep all the data.

any help,or links to examples would be appreciated.

### Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

#### ER_Neha

##### Board Regular
Hello I hope I understood your question. Kindly provide your feedback
Book2
ABC
1Sales Person Namesales dateSales
2Anna01-01-202010
3James01-02-20205
4John01-04-202010
5Anna01-02-20205
6James01-03-202010
7John15-04-202010
8Anna01-02-20205
Sheet1

This is the formula as in sheet 2
Book2
AB
1Sales Person NameTotal months of sale
2Anna2
3John1
4James2
5
Sheet2
Cell Formulas
RangeFormula
B2:B4B2=COUNT(UNIQUE(IF(Sheet1!\$A\$2:\$A\$8=Sheet2!A2,MONTH(Sheet1!\$B\$2:\$B\$8))))

#### Godders199

##### Active Member
Yes you did, thanks alot

#### ER_Neha

##### Board Regular
Yes you did, thanks alot
Thank you for the feedback. Happy to Help

Replies
0
Views
65
Replies
11
Views
155
Replies
7
Views
243
Replies
1
Views
80
Replies
0
Views
134

Threads
1,127,334
Messages
5,624,081
Members
416,010
Latest member
NJT

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

### Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

### Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back