View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Check if date is between two dates, then sum only those rows

In Sheet1,
you have startdate, enddate in A2:B2 down (these are assumed real dates)
put in C2:
=SUMPRODUCT((Sheet2!B$2:B$100=A2)*(Sheet2!B$2:B$1 00<=B2),Sheet2!G$2:G$100)
Copy down. The above returns the sum of amounts in Sheet2's col G where
dates in col B (in Sheet2, which must also be real dates) fall within the
startdate till enddate specified in A2 & B2 (inclusive). Modify easily to
suit. Arrive`? celebrate it, hit the YES below
--
Max
Singapore
---
"streetcar" wrote:
I have tab1 with begin date in column A, end date in column B. Basically they
are weeks, Mon-Sun (e.g. 01/04/2010 and 01/10/2010 in A/B resp.).

Tab2 has data I'd like to count and sum. The transaction date is in column B.

I want to sum tab2 column G (and a few other columns).

Tab2 will be dynamic as I add records to it. Tab1 remains static with each
week comprising one row.
--
streetcar