Forum Discussion

Anna McHaffie's avatar
Anna McHaffie
Copper Contributor
Jan 09, 2017

COUNTIFS using criteria from both column A and B

I can't figure out how to combine the formulas =COUNTIF(B:B,"IHC*")+COUNTIF(B:B,"SS*") and =COUNTIFS(A:A,">1330",A:A,"<1431")

 

I want to only count the criteria in column A if the criteria in column B is also met.

 

Thank you,

  • Hi Anna,

    You probably need to do 2 COUNTIFS given you want to count IHC* or SS*

    =COUNTIFS(A:A,">1330",A:A,"<1431",B:B,"IHC*") + COUNTIFS(A:A,">1330",A:A,"<1431",B:B,"SS*")
    • SergeiBaklan's avatar
      SergeiBaklan
      MVP

      Or bit more compact =SUM(COUNTIFS(B:B,{"SS*";"IHC*"},A:A,">1330",A:A,"<1431"))

      • Anna McHaffie's avatar
        Anna McHaffie
        Copper Contributor

        Thank you! I don't understand this one, but it gave me the same result as above! :smileyhappy:

Resources