I have a project I am working on where I would like to count the amount of times a state's abbreviation shows up in a range of cells.
I have gotten it to work with a certain code, however, it doesn't work if the state shows up more than three times (ex: TX, CA, CA, CA, CA). For California, it'll return 3 instead of the 4 that it should.
Here's my current code
=COUNTIF(Table1[State],","&I17)+COUNTIF(Table1[State],Stats!I17&",")+COUNTIF(Table1[State],Stats!I17)
The first COUNTIF takes into account if it follows a comma, the next if it precedes, and the last if "CA"(I17) is by itself in a cell.
I attached an example image of what I am trying to do here: Excel State Objective