Originally Posted by

**Prinny**
Sorry to ask again but I could use some more help with this. I've added the formula to my main data but I think I did something wrong as It's not giving the correct result.

The main data is on a sheet named Tracking. Column H has the date and Column C has the names.

My start date and end date are on sheet named Stats. This formula is also in a cell on the Stats sheet. Start date is cell E5. End date is cell G5.

I adjusted the formula because my data starts on row 4 and not row 2. I just changed the end of it to -3 instead of -1 on Dante's original. I also added an IF to deal with blank cells in the range h4:h999.

The formula is now:

=SUMPRODUCT(IF(Tracking!H4:H999="",0,(Tracking!H4:H999>=E5)*(Tracking!H4:H999<=G5)*(IF(COUNTIF(Tracking!C4:C999, Tracking!C4:C999)>1,1))*(MATCH(Tracking!C4:C999,Tracking!C4:C999,0)=ROW(Tracking!H4:H999)-3)))

I enter this as an array (ctrl+shift+enter).

The problem I have is the formula is counting the names that fall in the date range but have a duplicate anywhere in the range. I need to count the names that fall in the date range and have a duplicate within the date range also.

For context, the names are customers and the dates are order dates. I need to see how many customers ordered more than once in the range. For example, how many customers had more than one order in June.

Did I break the formula?

Try this

Code:

{=SUMPRODUCT((IF(COUNTIFS(C4:C13,C4:C13,H4:H13,">="&E5,H4:H13,"<="&G5)>1,1))*(MATCH(C4:C13, C4:C13,0)=ROW(H4:H13)-3))}

## Like this thread? Share it with others