View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Toppers
 
Posts: n/a
Default Formula using array to find embedded value

Ignore my last reply as the answer is in your first posting!

"Toppers" wrote:

How is "corename" defined? Is it a named range?

"Ted Horsch" wrote:

Thanks very much for the quick reply.

I tried this solution and it is close but not exactly what I need. When I
replace the "Y" with Corename I get the following results:

C2 = ABCDCCCXYZ returns AAA
C2 = ABCDEFGHIJK returns N
C2 = ABCDEFGHDDD returns CCC
C2 = AABBCCDDXYZ returns N

Actually, the spreadsheet is set up with multiple rows:

C2 = ABCDCCCXYZ returns AAA
D2 = ABCDEFGHIJK returns N
E2 = ABCDEFGHDDD returns CCC
F2 = AABBCCDDXYZ returns N

The range is in Col A rows 1 - 4.

How can I get ABCDCCCXYZ to return CCC and ABCDEFGHDDD to return DDD?

"Toppers" wrote:

Replace the "Y" (including quotes) with 'Corename'

=IF(SUMPRODUCT(COUNTIF(C2,"*"&Corename&"*")),Coren ame,"N")

HTH

"Ted Horsch" wrote:

Im using the following formula to determine if a set of values (CoreNames)
are present anywhere in cell C2:

=IF(SUMPRODUCT(COUNTIF(C2,"*"&CoreName&"*")),"Y"," N")

For example, if CoreName is a range containing four entries

CoreName
AAA
BBB
CCC
DDD

And my spread sheet contains these values in Col C Ill get the following
results

C2 = ABCDCCCXYZ returns Y
C2 = ABCDEFGHIJK returns N
C2 = ABCDEFGHDDD returns Y
C2 = AABBCCDDXYZ returns N

This works perfectly for me as is. However, I now need to go a step further
and return the specific CoreName value instead of returning Y. For example,
I want the following results from the values in Col C:

C2 = ABCDCCCXYZ returns CCC
C2 = ABCDEFGHIJK returns N
C2 = ABCDEFGHDDD returns DDD
C2 = AABBCCDDXYZ returns N

Can this be done with an enhancement to my formula above? Excel 2003 SP2