#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default IF() with #VALUE

IF(search(A1, B2)0,A,B)
I'm searching for a string in A1 in the cell B2, if B2 contains A1, search()
returns starting position of A1, and operation A is performed. However, when
it is not there, #VALUE is returned. How do I get operation B?
Thank you
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,268
Default IF() with #VALUE

=IF(ISNUMBER(SEARCH(A1,B2)),"A","B")

--


Regards,


Peo Sjoblom




"avgrin" wrote in message
...
IF(search(A1, B2)0,A,B)
I'm searching for a string in A1 in the cell B2, if B2 contains A1,
search()
returns starting position of A1, and operation A is performed. However,
when
it is not there, #VALUE is returned. How do I get operation B?
Thank you



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 964
Default IF() with #VALUE

Try this:

=IF(ISNUMBER(SEARCH(A1,B2),A,B)

This way, if SEARCH returns a number (starting position), A is performed.
Anything else (like #VALUE!), B is performed.

HTH,
Elkar


"avgrin" wrote:

IF(search(A1, B2)0,A,B)
I'm searching for a string in A1 in the cell B2, if B2 contains A1, search()
returns starting position of A1, and operation A is performed. However, when
it is not there, #VALUE is returned. How do I get operation B?
Thank you

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 695
Default IF() with #VALUE

=IF(ISERROR(SEARCH(A1,B2));"B";"A")


"avgrin" skrev:

IF(search(A1, B2)0,A,B)
I'm searching for a string in A1 in the cell B2, if B2 contains A1, search()
returns starting position of A1, and operation A is performed. However, when
it is not there, #VALUE is returned. How do I get operation B?
Thank you

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,118
Default IF() with #VALUE

Perhaps something like this:
=IF(COUNTIF(B1,"*"&A1&"*"),expr_A,expr_B)

Is that something you can work with?
--------------------------

Regards,

Ron (XL2003, Win XP)
Microsoft MVP (Excel)

"avgrin" wrote in message ...
IF(search(A1, B2)0,A,B)
I'm searching for a string in A1 in the cell B2, if B2 contains A1, search()
returns starting position of A1, and operation A is performed. However, when
it is not there, #VALUE is returned. How do I get operation B?
Thank you





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 695
Default IF() with #VALUE

ups

=IF(ISERROR(SEARCH(A1,B2)),"B","A")

"excelent" skrev:

=IF(ISERROR(SEARCH(A1,B2));"B";"A")


"avgrin" skrev:

IF(search(A1, B2)0,A,B)
I'm searching for a string in A1 in the cell B2, if B2 contains A1, search()
returns starting position of A1, and operation A is performed. However, when
it is not there, #VALUE is returned. How do I get operation B?
Thank you

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:35 PM.

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

About Us

"It's about Microsoft Excel"