How to Set a Specified Range for COUNTIF Function when using Autofill

Copper Contributor

I am using the COUNTIF function to count specific codes within a specified range of rows/columns. While I understand how to do this separately for each code, I would like to be able to replicate this COUNTIF function for each code I am trying to count. But, when I try to continue the pattern and use autofill (i.e. a set range of boxes and criteria matching a column of codes), the equation changes range and will not retain the original range I specified.

 

What gives! Does anyone know how to fix this? 

 

Thanks!

 

Cheers,

~Kela HW

3 Replies

@kelahw -

Are you trying to do something similar to what was posted at https://techcommunity.microsoft.com/t5/Excel/Conditional-Formatting-highlighting-cells-using-IF-form...?

 

This will count the occurrence of the initials in the range:

=COUNTIF($B$11:$J$23,$B$3:$B$8)

2cf.png

 

It was the exact issue!! I am realizing now that the absence of $ made a huge difference. Ugh wish I had caught that sooner. Thank you Chris!

@kelahw -

 

Yeah, really understanding cell referencing takes awhile (at least for me). It's practically a must though when using Conditional Formatting like what that post needed.