Conditional Counting Using Multiple Columns

Hi,

I have a column which represents a category (1, 2, 3, 4).

I have counted the amount of each category using the following condition:

=COUNTIF(F2:F331,"=2")

Produces the number in the category “2” etc.

I have another column which contains either 0 or 1.

I would like to have a condition that counts the amount of 1’s for every category.

I.e.:

IF CATEGORY = “3” AND OTHERCOLUMN = “1” ADD 1 TO COUNT

All advice appreciated.

Thanks

There is the COUNTIFS(range1;criteria1;range2;criteria2;range3;criteria3) function.

=COUNTIFS(F2:F331,"=2",G2:G331,4)

Thank you!