• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Excel question: finding text within a column?

I have two columns, column B with 100 items, and col A with 3000. What I want to do is figure out if a cell within col B is contained within a cell in Col A.

I want to use a formula like this in C:

=SEARCH(B1,$A$1:$A$3000) and return true/false or some sort of value.

So basically col B will look like this:

cat
dog
mouse

And col A looks like this:

hamster feed
bird cage
cat food

The cell which corresponds with B1, which contains cat will return true because "cat" exists within col A, and the dog and mouse cells are false since they don't exist.
 
Not sure about using the formula bar, but it would be pretty simple with a VBA macro:

sub search()

x = 1
y = 1

Do While Cells(y, 2) <> ""
Do While Cells(x, 1) <> ""
If InStr(1, Cells(x, 1), Cells(y, 2), 0) Then
Cells(y, 3) = "Found in Row: " & x
End If
x = x + 1
Loop
y = y + 1
Loop

end sub
 
Back
Top