A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Search Function that returns an integer not #VALUE!



 
 
Thread Tools Display Modes
  #1  
Old March 28th, 2007, 04:15 PM posted to microsoft.public.excel.worksheet.functions
DavidH
external usenet poster
 
Posts: 1
Default Search Function that returns an integer not #VALUE!

Hi
I'm trying to use a logical function to search text in a cell, see
below

=IF(SEARCH("DENTAL",A3,0) = 0, IF(SEARCH("VISION",A3,0) =
0,"yes","no"),"no")


Basically I need a way to determine if the defined text exists in
string and if so return flag that record. I'm comfortable using
access instr() function but I have a large amount of non-indexed
information and I'm trying to create a rule table rather than churn
away via an ODBC connection from Access.

My problem is that the search function won't return an integer, just
#Value!. Is there a function that can look for #VALUE! I was
thinking that it might be like isNA()

I'm not stuck on using the search function so alternative solutions
are greatly appreciated.

Thanks

David Hallidy

  #2  
Old March 28th, 2007, 04:21 PM posted to microsoft.public.excel.worksheet.functions
Pete_UK
external usenet poster
 
Posts: 8,780
Default Search Function that returns an integer not #VALUE!

Hi David, try this:

=IF(iserror(SEARCH("DENTAL",A3,0)),"no",IF(iserror (SEARCH("VISION",A3,0)),"no","yes"))

Hope this helps.

Pete

On Mar 28, 4:15 pm, "DavidH" wrote:
Hi
I'm trying to use a logical function to search text in a cell, see
below

=IF(SEARCH("DENTAL",A3,0) = 0, IF(SEARCH("VISION",A3,0) =
0,"yes","no"),"no")

Basically I need a way to determine if the defined text exists in
string and if so return flag that record. I'm comfortable using
access instr() function but I have a large amount of non-indexed
information and I'm trying to create a rule table rather than churn
away via an ODBC connection from Access.

My problem is that the search function won't return an integer, just
#Value!. Is there a function that can look for #VALUE! I was
thinking that it might be like isNA()

I'm not stuck on using the search function so alternative solutions
are greatly appreciated.

Thanks

David Hallidy



  #3  
Old March 28th, 2007, 04:26 PM posted to microsoft.public.excel.worksheet.functions
Ron Coderre
external usenet poster
 
Posts: 620
Default Search Function that returns an integer not #VALUE!

Let's see if I understand correctly

If Cell A3 contains either "Dental" or "Vision" (or both, presumably)
Return "No"
Otherwise, return "Yes"

If that's true, try this:
=IF(MAX(COUNTIF(A3,{"*Dental*","*Vision*"})),"No", "Yes")

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"DavidH" wrote:

Hi
I'm trying to use a logical function to search text in a cell, see
below

=IF(SEARCH("DENTAL",A3,0) = 0, IF(SEARCH("VISION",A3,0) =
0,"yes","no"),"no")


Basically I need a way to determine if the defined text exists in
string and if so return flag that record. I'm comfortable using
access instr() function but I have a large amount of non-indexed
information and I'm trying to create a rule table rather than churn
away via an ODBC connection from Access.

My problem is that the search function won't return an integer, just
#Value!. Is there a function that can look for #VALUE! I was
thinking that it might be like isNA()

I'm not stuck on using the search function so alternative solutions
are greatly appreciated.

Thanks

David Hallidy


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:16 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.