Find a text within a range of cells

gaftalik

Well-known Member
Joined
Feb 6, 2003
Messages
521
Office Version
  1. 2016
Platform
  1. Windows
Hi,

A B

joe b elena c
tony bob c
joe a tom

i need a formula if joe b exists in A1:B3 return "yes" other wise "NO"

Thank you (y)

Gaftalik
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Next Step_
And If I like to search in all sheets in one shot ?

Example:

here the special counting is limited to -notes- sheet =COUNTIF(notes!A:ZZ;"*"&F13&"*")

there is some way to use the wildcards for sheetname like an immaginary =COUNTIF("*"!A:ZZ;"*"&F13&"*")
 
Upvote 0
Hi Paolo,
To my knowledge there's no simple way to just tell Excel to check all existing sheets.
You'll need at least a list of the names of sheets. Then you can use array formula to check all from that list.

Let's say you listed your sheet names that you'd like to search in a column ranging from A1 to A20 (and D1 contains what you'd like to find), then you can use this formula, to apply the search to all sheets. INDIRECT lets you create the sheet references using a formula and the Array feature applies it to all of them that you listed. It is very important that after adding the formula in the bar do not press Enter! Press instead Ctrl+Shift+Enter, this is how you apply Array formulae.
=SUM(COUNTIF(INDIRECT("'"&A1:A20&"'!A:ZZ");"*"&D1&"*"))
when done correctly, it will appear in brackets like this:
{=SUM(COUNTIF(INDIRECT("'"&A1:A20&"'!A:ZZ");"*"&D1&"*"))}
 
Upvote 0

Forum statistics

Threads
1,215,040
Messages
6,122,806
Members
449,095
Latest member
m_smith_solihull

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