COUNTIFS

Occasional Contributor

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?

 

=COUNTIFS(B:B, "R", H:H, "R")

 

Thanks,

Tony

2 Replies

@DraygonTech 

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")

@Riny_van_Eekelen 

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