Looking for text and returning the number of times it appears

Longshot9

New Member
Joined
Aug 25, 2010
Messages
22
Hi All,

Here's what I need to do... search a bunch of cells for a specific text string, and return the number of times that text appears. I had this working before in a range of cells, but that range changed this time and now it's broken for some reason.

Here's the data...

A22 - the text to search for
B22 - the cell to return the number of times the text appears
I26-GB33 - the first range of cells
I35-GB40 - the second range

So for example, if A22 was Los Angeles, and Los Angeles appeared 10 times anywhere in cells I26-GB40, it would put 10 in B22. Row 34 has no data in it at all.

This is what I used before that worked, when I did this, it was I26-GB32, and I34-GB39. The first range increased 1 row this time.

=COUNTIF($I$27:$GB$40,A22) I don't know why I put to GB40 in there, there was no data on row 40. But it worked.

Any suggestions? Thanks!
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
ugh, nevermind. I think I figured out the problem. Up until around column BX, I was putting in the items as follows

BW - 1. BX - Los Angeles

It was working fine to that point. After BX I was doing this

BY - 1. Los Angeles

I'm guessing it wasn't finding it because the string didn't perfectly match. Switching it from BY to GB by separating the Numbers to their own columns fixed it. It's way to early in the morning to be doing this... lol.

Thanks for the suggestion though VoG. I appreciate the response.
 
Upvote 0

Forum statistics

Threads
1,224,537
Messages
6,179,408
Members
452,912
Latest member
alicemil

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top