ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   sumif formula based on dates (https://www.excelbanter.com/excel-worksheet-functions/203848-sumif-formula-based-dates.html)

linnipen

sumif formula based on dates
 
I have the following partial spreadsheet:

Date Total Hours Compensation
1/15/2008 11.00 $133.43
1/22/2008 12.15 $147.38
2/8/2008 12.00 $145.56

Is there an IF function that can be used to calculate the running total
Compensation by month without using the subtotal function? I would like this
total to automatically calculate when data is added to the spreadsheet.



bpeltzer

sumif formula based on dates
 
=SUMIF(A:A,"=" & DATE(2008,1,1),C:C)-SUMIF(A:A,"=" & DATE(2008,2,1),C:C)
That adds the comp from all entries dated on or after 1/1/2008 and subtracts
the total of all entries from 2/1/2008. What's left is the total from Jan
'08. Note that the dates could instead be cell references with the 'from'
and 'until' dates.

"linnipen" wrote:

I have the following partial spreadsheet:

Date Total Hours Compensation
1/15/2008 11.00 $133.43
1/22/2008 12.15 $147.38
2/8/2008 12.00 $145.56

Is there an IF function that can be used to calculate the running total
Compensation by month without using the subtotal function? I would like this
total to automatically calculate when data is added to the spreadsheet.



T. Valko

sumif formula based on dates
 
One way:

To sum for January 2008:

=SUMPRODUCT(--(MONTH(A1:A10)=1),--(YEAR(A1:A10)=2008),C1:C10)

For other months just change =1 to whatever month number you're interested
in.


--
Biff
Microsoft Excel MVP


"linnipen" wrote in message
...
I have the following partial spreadsheet:

Date Total Hours Compensation
1/15/2008 11.00 $133.43
1/22/2008 12.15 $147.38
2/8/2008 12.00 $145.56

Is there an IF function that can be used to calculate the running total
Compensation by month without using the subtotal function? I would like
this
total to automatically calculate when data is added to the spreadsheet.






All times are GMT +1. The time now is 04:48 PM.

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