ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   how do i sum 2 values that fall between date ranges? (https://www.excelbanter.com/excel-worksheet-functions/19841-how-do-i-sum-2-values-fall-between-date-ranges.html)

Neil

how do i sum 2 values that fall between date ranges?
 
i have several columns, for profit costs, VAT etc, on a seperate sheet within
the same workbook i want to create a summary sheet which totals all of the
profit costs that fall within each month.

i.e. sum of profit costs for february.

i have tried for hours without success, this is my current effort:

=SUM(IF(('Adam Burton - Costs Recovered.xls'!Date"31/12/2004")+('Adam
Burton - Costs Recovered.xls'!Date<"01/02/2005"),Paid!D4:D1000))

can anyone please help!?

Neil

Peo Sjoblom

An example could look like this

=SUMPRODUCT(--(A4:A1000DATE(2004,12,31)),--(A4:A1000<DATE(2005,2,1)),D4:D1000)

where A4:A1000 holds the dates and D4:D1000 the values you want to sum
Note that the date range needs to be of the same size as the sum range

--
Regards,

Peo Sjoblom


"Neil" wrote in message
...
i have several columns, for profit costs, VAT etc, on a seperate sheet
within
the same workbook i want to create a summary sheet which totals all of the
profit costs that fall within each month.

i.e. sum of profit costs for february.

i have tried for hours without success, this is my current effort:

=SUM(IF(('Adam Burton - Costs Recovered.xls'!Date"31/12/2004")+('Adam
Burton - Costs Recovered.xls'!Date<"01/02/2005"),Paid!D4:D1000))

can anyone please help!?

Neil




Ron Rosenfeld

On Wed, 30 Mar 2005 06:43:04 -0800, "Neil"
wrote:

i have several columns, for profit costs, VAT etc, on a seperate sheet within
the same workbook i want to create a summary sheet which totals all of the
profit costs that fall within each month.

i.e. sum of profit costs for february.

i have tried for hours without success, this is my current effort:

=SUM(IF(('Adam Burton - Costs Recovered.xls'!Date"31/12/2004")+('Adam
Burton - Costs Recovered.xls'!Date<"01/02/2005"),Paid!D4:D1000))

can anyone please help!?

Neil


Look at the SUMIF function.

For January 2004, something like:

=SUMIF(Dt,"="&DATE(2004,1,1),Paid)-
SUMIF(Dt,""&DATE(2004,1,31),Paid)

This assumes that Dt and Paid are named ranges on the appropriate worksheet.


--ron


All times are GMT +1. The time now is 10:48 AM.

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