Forum Discussion
DraygonTech
Apr 29, 2022Copper Contributor
COUNTIFS
If I use COUNTIF or COUNTIFS on one column, it returns 17 (correctly). But when I try to add the second column in COUNTIFS, it returns 0 (very incorrectly). Am I messing up the syntax? =COUNTIF...
Riny_van_Eekelen
Apr 29, 2022Platinum Contributor
COUNTIFS returns the count of items that match ALL criteria. Thus, the number of cells that contain "R" in both columns B and H (i.e. on the same row).
Try this one in stead:
=COUNTIF(B:B,"R")+COUNTIF(H:H,"R")
- DraygonTechApr 29, 2022Copper Contributor
So, a +1 only occurs when the "R" exists for both Columns B and H, on each row?
That is so weird... but makes sense why a 0 was returned, as the data sets are not on the same rows.
Adding the COUNTIFS() together returns the expected result... but completely bypasses the entire reason I was using COUNTIFS.. might as well just add COUNTIF() statements! 😛
Regardless, you helped me with the solution I was needing. I really appreciate it.
Best,
Tony