# SumIF and CountIF with dates

#### sarahjane2019

##### New Member
Hi
I have dataset of customers who purchase plans each month. This data has approx.75,000 lines. This list consists of: customer, amount, month. I have created a pivot table with the following:

• Rows: customers
• Values: amount
• Columns: month (15 months)
What I am trying to find out is the number of customers who are lost each month and the number of customers that are gained each month as well as the revenue gained and lost figures. I need to know the month they first purchased a plan, and the last plan they purchased. I have used SUMIFs and COUNTIFs however the numbers don't add up. What formulas would you use to work this out?

### Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

#### Panda514

##### New Member
Hello, you could use a vlookup to see who the returning customers are. For example, I would copy/paste the February 2019 customers onto a new tab and remove duplicate customers names/ID's then vlookup the February 2019 customers to the list of all your previous employees. This will tell you who the returning customers and who the new customers are in February 2019.

If you need to know the month they first purchased a plan then add a column for earliest and oldest. You will have to reference the tab that has all of the customer data.

For earliest, use =IF(MIN(IF(range of all customers on the full list="first cell of customer on Feb list",range of dates on the full list))=0,"")
For oldest, use the same formula as above, but change MIN to MAX.

I hope this helps! Someone may be able to come up with a much simpler way, but I saw that you had no replies and wanted to help.

Replies
2
Views
362
Replies
2
Views
79
Replies
5
Views
232
Replies
3
Views
173
Replies
8
Views
583

Threads
1,127,706
Messages
5,626,396
Members
416,180
Latest member
Excel_user12321

### 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