Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 168
Default A find formul looking at two named ranges for two strings

If I have two named ranges, Range_1 and Range_2...

and

Cell A1 has a string that may or may not be in Range_1

and

Cell B1 has a string that may or may not be in Range_2

is there a formula that will return a YES if both strings are present in the respective named ranges or a NO if either string is not present in its respective range?

Say Range_1 is A2:A150, Range_2 is C2:J200.

Thanks,
Howard
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 168
Default A find formul looking at two named ranges for two strings

On Wednesday, August 28, 2013 7:12:53 PM UTC-7, wrote:
If I have two named ranges, Range_1 and Range_2...



and



Cell A1 has a string that may or may not be in Range_1



and



Cell B1 has a string that may or may not be in Range_2



is there a formula that will return a YES if both strings are present in the respective named ranges or a NO if either string is not present in its respective range?



Say Range_1 is A2:A150, Range_2 is C2:J200.



Thanks,

Howard


This seems to work, and I will adjust the ranges and cells.
Sorry, I should have pondered a bit more before posting.

=IF(SUMPRODUCT(--($A$8:$A$40=B5)*($B$8:$M$40=B4))<0,"YES","NO")

Regards,
Howard
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 168
Default A find formul looking at two named ranges for two strings

On Wednesday, August 28, 2013 11:14:04 PM UTC-7, Claus Busch wrote:
Hi Howard,



Am Wed, 28 Aug 2013 19:23:55 -0700 (PDT) schrieb :



=IF(SUMPRODUCT(--($A$8:$A$40=B5)*($B$8:$M$40=B4))<0,"YES","NO")




that only works, if both search strings are in the same row in your

ranges.

Try:

=IF(COUNT(FIND(B4,B8:M40))*COUNT(FIND(B5,A8:A40)) 0,"Yes","No")

And enter the array formula with CTRL+Shift+Enter



Regards

Claus B.


Excellent point!

Thanks Claus.

Regards,
Howard
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 168
Default A find formul looking at two named ranges for two strings


Also:

=IF((COUNTIF(Range_1,"*"&A1&"*")+COUNTIF(Range_2," *"& B1&"*"))=2,"Yes","No")


Thanks, Ron.

I am puzzled with the "*"&A1&"*"

Googled and looked in my J. Walkenbach references but can't find a "...here's what this does."

Regards,
Howard

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,872
Default A find formul looking at two named ranges for two strings

Hi Ron,

Am Thu, 29 Aug 2013 06:58:30 -0400 schrieb Ron Rosenfeld:

=IF((COUNTIF(Range_1,"*"&A1&"*")+COUNTIF(Range_2," *"& B1&"*"))=2,"Yes","No")


if the occurrence of search string1 in Range_1 is 2 times and of search
string2 in Range_2 is none, then you will get also "Yes"
I would change it to:
=IF((COUNTIF(Range_1,A1)*COUNTIF(Range_2,B1))0,"Y es","No")


Regards
Claus B.
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,045
Default A find formul looking at two named ranges for two strings

On Thu, 29 Aug 2013 18:23:33 +0200, Claus Busch wrote:

Hi Ron,

Am Thu, 29 Aug 2013 06:58:30 -0400 schrieb Ron Rosenfeld:

=IF((COUNTIF(Range_1,"*"&A1&"*")+COUNTIF(Range_2," *"& B1&"*"))=2,"Yes","No")


if the occurrence of search string1 in Range_1 is 2 times and of search
string2 in Range_2 is none, then you will get also "Yes"
I would change it to:
=IF((COUNTIF(Range_1,A1)*COUNTIF(Range_2,B1))0," Yes","No")



Ah, yes. Good point.
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
Given Address, find named ranges that contain it INTP56 Excel Programming 1 January 23rd 08 12:42 AM
Named ranges scope / workbook/worksheet level named ranges- changeswith variable use... christian_spaceman Excel Programming 3 December 24th 07 01:15 PM
How do I find all named ranges in VB.NET? John Brock Excel Discussion (Misc queries) 5 September 2nd 05 04:39 PM
How do I find all named ranges in VB.NET? John Brock Excel Programming 5 September 2nd 05 04:39 PM


All times are GMT +1. The time now is 05:06 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"