Our purchasing dept. has a huge spreadsheet. They have a column for budget 2005 and a column for expenditures 2005. They want to sum the expenditures 2005 column where the date range column is >=1/1/2005 and <=1/31/2005. I typed just a small sample to see if I could get the sumif to work for a specified date range.
checks date amount
15000 1/1/2005 5
16000 1/1/2005 5
16001 1/11/2005 5
16002 1/12/2005 5
16003 2/1/2005 10
16004 2/2/2005 10
16005 2/3/2005 10
16006 2/4/2005 10
The following formula works:
=SUMIF(B2:B9,"<=1/31/2005",C2:C9 I get 20 which is correct.
This will work for January, but in February I will not be able to do <=2/28/2005 because this will also include January. In February I must have >= 2/1/2005 and <=2/28/2005. Eventually I will need to do this for all the months in a huge spreadsheet. I tried changing the formula to
=SUMIF(B2:B9,">=1/1/2005*<=1/31/2005",C2:C9) but I get a 0
Then I changed the formula to
=SUMIF(B2:B9,">=datevalue(1/1/2005)*<=datevalue(1/31/2005)",C2:C9)
and again I got a 0. What am I doing wrong?
Thanks!
checks date amount
15000 1/1/2005 5
16000 1/1/2005 5
16001 1/11/2005 5
16002 1/12/2005 5
16003 2/1/2005 10
16004 2/2/2005 10
16005 2/3/2005 10
16006 2/4/2005 10
The following formula works:
=SUMIF(B2:B9,"<=1/31/2005",C2:C9 I get 20 which is correct.
This will work for January, but in February I will not be able to do <=2/28/2005 because this will also include January. In February I must have >= 2/1/2005 and <=2/28/2005. Eventually I will need to do this for all the months in a huge spreadsheet. I tried changing the formula to
=SUMIF(B2:B9,">=1/1/2005*<=1/31/2005",C2:C9) but I get a 0
Then I changed the formula to
=SUMIF(B2:B9,">=datevalue(1/1/2005)*<=datevalue(1/31/2005)",C2:C9)
and again I got a 0. What am I doing wrong?
Thanks!