Excel SUMIF between dates

前端 未结 5 1943
隐瞒了意图╮
隐瞒了意图╮ 2020-12-18 19:22

I have column A with date values formatted as mm/dd/yyyy. I am trying to sum the values of column B if A >=DATE(2012,1,1) AND

=SUM(B:B) sums

相关标签:
5条回答
  • 2020-12-18 19:46

    You haven't got your SUMIF in the correct order - it needs to be range, criteria, sum range. Try:

    =SUMIF(A:A,">="&DATE(2012,1,1),B:B)
    
    0 讨论(0)
  • 2020-12-18 19:46

    this works, and can be adapted for weeks or anyother frequency i.e. weekly, quarterly etc...

    =SUMIFS(B12:B11652,A12:A11652,">="&DATE(YEAR(C12),MONTH(C12),1),A12:A11652,"<"&DATE(YEAR(C12),MONTH(C12)+1,1))

    0 讨论(0)
  • 2020-12-18 19:46

    One more solution when you want to use data from any sell ( in the key C3)

    =SUMIF(Sheet6!M:M;CONCATENATE("<";TEXT(C3;"dd.mm.yyyy"));Sheet6!L:L)
    
    0 讨论(0)
  • 2020-12-18 19:48

    I found another way to work around this issue that I thought I would share.

    In my case I had a years worth of daily columns (i.e. Jan-1, Jan-2... Dec-31), and I had to extract totals for each month. I went about it this way: Sum the entire year, Subtract out the totals for the dates prior and the dates after. It looks like this for February's totals:

    =SUM($P3:$NP3)-(SUMIF($P$2:$NP$2, ">2/28/2014",$P3:$NP3)+SUMIF($P$2:$NP$2, "<2/1/2014",$P3:$NP3))
    

    Where $P$2:$NP$2 contained my date values and $P3:$NP3 was the first row of data I am totaling. So SUM($P3:$NP3) is my entire year's total and I subtract (the sum of two sumifs):

    SUMIF($P$2:$NP$2, ">2/28/2014",$P3:$NP3), which totals all the months after February and SUMIF($P$2:$NP$2, "<2/1/2014",$P3:$NP3), which totals all the months before February.

    0 讨论(0)
  • 2020-12-18 20:06

    To SUMIFS between dates, use the following:

    =SUMIFS(B:B,A:A,">="&DATE(2012,1,1),A:A,"<"&DATE(2012,6,1))
    
    0 讨论(0)
提交回复
热议问题