sumif formula based on dates

L

linnipen

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.
 
B

bpeltzer

=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.
 
T

T. Valko

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top