Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / July 2006

Tip: Looking for answers? Try searching our database.

Lookup or index match for "contains" rather than exact match -- find/search?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Excel@shoenfeltconsulting.com - 06 Jun 2006 19:06 GMT
Range1:
A1: apple
B1: banana
C1: carrot

Range2:
A2:fruit
B2: fruit
C2: vegetable

A3: Granny Smith Apple

Range 1 and Range 2 are always the same size, but much larger in
reality.

Here's the "formula" I want to create in A4:

If A3 contains 'apple (the first entry in range1), then return 'Fruit'
(the first entry in range2), if A3 contains 'banana' (the 2nd entry of
range1) then return 'Fruit' (the 2nd entry of range2), if a3 contains
'carrot' (the 3rd entry of range1) then return 'vegettable' (the 3rd
entry of range2), otherwise return 'blah'

I don't just want to write this with simple if then statements because
Range1 and Range2 are in practice much larger.  This would be easy to
do with Match and Index if A3 exactly matched an entry in Range 1.  But
it might not. But A3 only has to CONTAIN one of the entries in Range1.

Hope that makes sense...

Excel@ShoenfeltConsulting.com
Domenic - 06 Jun 2006 23:03 GMT
Try...

=IF(OR(ISNUMBER(SEARCH(A1:C1,A3))),INDEX(A2:C2,MATCH(TRUE,ISNUMBER(SEARCH
(A1:C1,A3)),0)),"")

...confirmed with CONTROL+SHIFT+ENTER, not just ENTER.

Hope this helps!

> Range1:
> A1: apple
[quoted text clipped - 27 lines]
>
> Excel@ShoenfeltConsulting.com
Excel@shoenfeltconsulting.com - 02 Jul 2006 22:44 GMT
I had never thought to use "search" as an array like this.  That was
just what I had in mind.  Thank you.

Jim

> Try...
>
[quoted text clipped - 36 lines]
> >
> > Excel@ShoenfeltConsulting.com
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.