Avatar of Michael Vasilevsky
Michael Vasilevsky
Flag for United States of America asked on

Using SUMPRODUCT with a Date Range

I'm trying to sum the number of dates with in a range for a given document type using SUMPRODUCT in the attached example spreadsheet.

I can get the formula to return the correct value for a single date, but I want to sum over a range of dates, specifically the entire week.

The formula is in Summary!C2. I thought =SUMPRODUCT(--(Dates!A2:A392=A2),--(Dates!B2:B392=C1), --(Dates!B2:B392=C1+1), ...) would work but that returns 0.

What am I missing?

Thank you!
Test-Spreadsheet-MV.xlsx
Microsoft OfficeMicrosoft ExcelSpreadsheets

Avatar of undefined
Last Comment
Michael Vasilevsky

8/22/2022 - Mon
Shums Faruk

You may try =COUNTIFS(Dates!$B:$B,"="&D$1,Dates!$A:$A,$A2)
Test-Spreadsheet-MV_v1.xlsx
Des Kelly

SUMPRODUCT is a function used to add (SUM) a range of multiplications (PRODUCTS)
How are you planning on multiplying dates?

I thought long and hard before replying - I don't think I am missing something?  Your source data are dates - SUMPRODUCT won't apply!
Arana (G.P.)

I think you want to COUNT the dates and not SUM (add them)
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
Shums Faruk

I already noticed and gave him CountIF option
ASKER CERTIFIED SOLUTION
Ejgil Hedegaard

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Michael Vasilevsky

ASKER
Thank you!