ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Check if date is between two dates, then sum only those rows (https://www.excelbanter.com/excel-worksheet-functions/256343-check-if-date-between-two-dates-then-sum-only-those-rows.html)

streetcar

Check if date is between two dates, then sum only those rows
 
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

Eva

Check if date is between two dates, then sum only those rows
 
The best tool for it is a pivot table. Put in your layaut col A & B in row
section, col G in Data section (double click to change it to sum - "sumarize
by")

Click yes if helped
--
Greatly appreciated
Eva


"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


Max

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



All times are GMT +1. The time now is 09:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com