Forum Discussion

David van der Weele's avatar
David van der Weele
Copper Contributor
Mar 06, 2018

Using SUMIF (SOM.ALS) or NUMBERIF (AANTAL.ALS) in case of not contiguous cells

My question is,

Which formula counts the numbers "1", but only for the ranges:

- January, february and march AND

- July, August and September.

 

Fot the clarity, the outcome should be 2.

 

I hope you can help me.

 

  A B
  Month Number
1 Januari 1
2 Februari 2
3 Maart 3
4 April 1
5 Mei 2
6 Juni 3
7 Juli 1
8 Augustus 2
9 September 3
10 Oktober 1
11 November 2
12 December 3

5 Replies

  • Tinn Keeper's avatar
    Tinn Keeper
    Brass Contributor
    or
    =SUMPRODUCT(COUNTIFS(A1:A12,{"January","February","March","July","August","September"},B1:B12,1))
    • David van der Weele's avatar
      David van der Weele
      Copper Contributor

      Thank you for your recommandation.

      When using the recommended formula, I get the error message: "The formula you typed contains an error." I don''t know what the error causes. In case of any suggestions, I like to hear them.

  • SergeiBaklan's avatar
    SergeiBaklan
    Diamond Contributor

    Hi David,

     

    Could be like

    =SUMPRODUCT((A2:A12={"January", "February", "March", "July", "August", "September"})*(B1:B12=1))
    • David van der Weele's avatar
      David van der Weele
      Copper Contributor

      Thank you for your recommandation.

      When using the recommended formula, I get the error message: "The formula you typed contains an error." I don''t know what the error causes. In case of any suggestions, I like to hear them.

       

Resources