#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 103
Default Search Function

Hi,

Following function formula gives me a result like"Direct FundingsDirect
Fundings". How can I modify the formula so that the result is "Direct
Fundings" once instead of layers. I know my text string has both words "VAR"
and "Intercompany" in it.

=(IF(ISERROR(SEARCH("VAR",AC81)),"","Direct
Fundings")&IF(ISERROR(SEARCH("Direct Funding",AC81)),"","Direct
Fundings")&IF(ISERROR(SEARCH("Intercompany",AC81)) ,"","Direct Fundings")

Thanks,
Dinesh

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 222
Default Search Function

You need to flip the logic around so it only answers one time, using the &
causes the function to repeat:

=IF(ISERROR(SEARCH("VAR",E12)),
IF(ISERROR(SEARCH("Direct Funding",E12)),
IF(ISERROR(SEARCH("Intercompany",E12)),
"","Direct Funding"),"Direct Funding"),"Direct Funding")

That can DEFINITELY be shortened, but for now, that will work.
--
"Actually, I *am* a rocket scientist." -- JB

Your feedback is appreciated, click YES if this post helped you.


"Dinesh" wrote:

Hi,

Following function formula gives me a result like"Direct FundingsDirect
Fundings". How can I modify the formula so that the result is "Direct
Fundings" once instead of layers. I know my text string has both words "VAR"
and "Intercompany" in it.

=(IF(ISERROR(SEARCH("VAR",AC81)),"","Direct
Fundings")&IF(ISERROR(SEARCH("Direct Funding",AC81)),"","Direct
Fundings")&IF(ISERROR(SEARCH("Intercompany",AC81)) ,"","Direct Fundings")

Thanks,
Dinesh

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Search Function

Try it like this:

=IF(OR(ISNUMBER(SEARCH({"VAR","Direct
Funding","Intercompany"},AC81))),"Direct Fundings","")

--
Biff
Microsoft Excel MVP


"Dinesh" wrote in message
...
Hi,

Following function formula gives me a result like"Direct FundingsDirect
Fundings". How can I modify the formula so that the result is "Direct
Fundings" once instead of layers. I know my text string has both words
"VAR"
and "Intercompany" in it.

=(IF(ISERROR(SEARCH("VAR",AC81)),"","Direct
Fundings")&IF(ISERROR(SEARCH("Direct Funding",AC81)),"","Direct
Fundings")&IF(ISERROR(SEARCH("Intercompany",AC81)) ,"","Direct Fundings")

Thanks,
Dinesh



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Search Function

Another one that saves a couple of keystrokes:

=IF(SUM(COUNTIF(AC81,{"*VAR*","*Direct Funding*","*Intercompany*"})),"Direct
Fundings","")

--
Biff
Microsoft Excel MVP


"T. Valko" wrote in message
...
Try it like this:

=IF(OR(ISNUMBER(SEARCH({"VAR","Direct
Funding","Intercompany"},AC81))),"Direct Fundings","")

--
Biff
Microsoft Excel MVP


"Dinesh" wrote in message
...
Hi,

Following function formula gives me a result like"Direct FundingsDirect
Fundings". How can I modify the formula so that the result is "Direct
Fundings" once instead of layers. I know my text string has both words
"VAR"
and "Intercompany" in it.

=(IF(ISERROR(SEARCH("VAR",AC81)),"","Direct
Fundings")&IF(ISERROR(SEARCH("Direct Funding",AC81)),"","Direct
Fundings")&IF(ISERROR(SEARCH("Intercompany",AC81)) ,"","Direct Fundings")

Thanks,
Dinesh





  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 222
Default Search Function

Heh, forgot the SEARCH portion that time...
--
"Actually, I *am* a rocket scientist." -- JB

"T. Valko" wrote:

Another one that saves a couple of keystrokes:

=IF(SUM(COUNTIF(AC81,{"*VAR*","*Direct
Funding*","*Intercompany*"})),"Direct Fundings","")



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default Search Function

No, Biff's formula is correct as written... he used a different approach
that doesn't require the SEARCH function. Try the two formulas he posted out
to see that they react the same.

--
Rick (MVP - Excel)


"JBeaucaire" wrote in message
...
Heh, forgot the SEARCH portion that time...
--
"Actually, I *am* a rocket scientist." -- JB

"T. Valko" wrote:

Another one that saves a couple of keystrokes:

=IF(SUM(COUNTIF(AC81,{"*VAR*","*Direct
Funding*","*Intercompany*"})),"Direct Fundings","")


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 222
Default Search Function

Of course...those little wildcards blend into the quotes in this tiny little
forum font. good stuff!
--
"Rick Rothstein" wrote:

No, Biff's formula is correct as written... he used a different approach
that doesn't require the SEARCH function. Try the two formulas he posted out
to see that they react the same.

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Search Function

Ok, this is my final answer! <g

Saves a few more keystrokes:

=IF(COUNT(SEARCH({"VAR","Direct Funding","Intercompany"},AC81)),"Direct
Fundings","")

--
Biff
Microsoft Excel MVP


"JBeaucaire" wrote in message
...
Of course...those little wildcards blend into the quotes in this tiny
little
forum font. good stuff!
--
"Rick Rothstein" wrote:

No, Biff's formula is correct as written... he used a different approach
that doesn't require the SEARCH function. Try the two formulas he posted
out
to see that they react the same.



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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Search Function Manos Excel Worksheet Functions 1 March 12th 08 11:39 AM
SEARCH function help Eric Shamlin Excel Worksheet Functions 2 May 4th 06 01:25 AM
How do I add a search function? Jadziah New Users to Excel 3 December 15th 05 08:19 AM
Search Function.. Jadziah New Users to Excel 0 December 12th 05 06:38 PM
VBA Search function tamato43 Excel Discussion (Misc queries) 0 March 29th 05 08:09 PM


All times are GMT +1. The time now is 05:27 AM.

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"