Forum Discussion

lyc999's avatar
lyc999
Copper Contributor
Aug 07, 2024
Solved

COUNTIFS returns #VALUE!. Each of the criteria works in its countif. Reason: compare span 2 cols.

Hi:  I have a COUNTIFS return #VALUE! when each of the 2 criteria would work in a COUNTIF on its own. So, =COUNTIF($B$6:$C$33,"Apple")  and =COUNTIF($D$6:$D$33,"US")  both work on their own each ret...
  • HansVogelaar's avatar
    Aug 07, 2024

    lyc999 

    The range arguments of COUNTIFS must have the same size.

    Option 1: add 2 separate COUNTIFS:

    =COUNTIFS($B$6:$B$33,"Apple",$D$6:$D$33,"US")+COUNTIFS($C$6:$C$33,"Apple",$D$6:$D$33,"US")

    Option 2: use SUM or SUMPRODUCT

    =SUMPRODUCT((B6:C33="Apple")*(D6:D33="US"))

Resources