Forum Discussion
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 KeeperBrass Contributoror
=SUMPRODUCT(COUNTIFS(A1:A12,{"January","February","March","July","August","September"},B1:B12,1))- David van der WeeleCopper 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.
- SergeiBaklanDiamond Contributor
Hi David,
Could be like
=SUMPRODUCT((A2:A12={"January", "February", "March", "July", "August", "September"})*(B1:B12=1))
- David van der WeeleCopper 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.
- SergeiBaklanDiamond Contributor
Hi David,
Please see both formulas attached. Range adjusted from B1:B12 to B2:B13