finding if name within range

  • Thread starter Thread starter sheila
  • Start date Start date
S

sheila

If i have a range, lets name it "Names" and i want to find if the name
George is in that range, what formula should I use?

TIA
sheila
 
Use the COUNTIF() function.

=COUNTIF(Names,"George")

This will give you a count of the number of times George is there
 
I *think* Anne may have misread the question. Try this function:

Function IsGeorgeInThere() As Boolean
Dim c As Range
For Each c In Range("Names").Cells
If c = "George" Then
IsGeorgeInThere = True
Exit Function
End If
Next
End Function
 
Sorry, I just realized you wanted a formula. Try:

=COUNTIF(Names,"George")>0
 
Cutter, I think your PC clock may be wrong (or the time zone is incorrectly
set) ...
 
Kind of right, but if the name George does appear in the range, I want
that name (George) to appear in the cell that has the formula.

how do i do that?


TIA
sheila
 
and i guess i should also add, IF the name George doesnt appear in the
range, then I would like something else searched and used (say
"Harry"),,does that make sense??
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top