Forum Discussion

Jamesboden's avatar
Jamesboden
Copper Contributor
Sep 08, 2022

Formula for adding certain cells

Hey Folks

 

Not sure if this is possible.  I need a formula that will add cells together depending on what is put in another cell. 

So if in A it says 1 - I need to add up all the amounts in C that are on the same line as 1. 

 

So if A1, A3, & A4 all show 1. I need the values of C1,C3 & C4 adding together to get me a total value. 

 

Hope this makes sense. 

11 Replies

    • Jamesboden's avatar
      Jamesboden
      Copper Contributor
      Hey Hans. Thats great thank you. Would you know how to add a date range to it. so 01/08 to 31/08?
      • HansVogelaar's avatar
        HansVogelaar
        MVP

        Jamesboden 

        Let's say you have dates in column D. This time, we'll use SUMIFS:

         

        =SUMIFS(C1:C100, A1:A100, 1, D1:D100, ">="&DATE(2022, 8, 1), D1:D100, "<="&DATE(2022, 8, 31))

         

        Instead of including the literal dates in the formula, you can refer to cells - say K1 contains 01/08/2022 and K2 contains 31/08/2022:

         

        =SUMIFS(C1:C100, A1:A100, 1, D1:D100, ">="&K1, D1:D100, "<="&K2)

Resources