Formula to identify a value within an array

Saulos

New Member
Joined
Aug 9, 2022
Messages
5
Office Version
  1. 365
Platform
  1. Windows
Hello everyone, I hope you are having a pleasant day!

I am not an expert Excel user, and I have been struggling to find a formula that can help me identify whether a value (in my case, text) is contained within an array.

Below the use-case:

Column D contains a sample set of "Product Names".

Column A contains a sample set of "Advertisement Titles" from eBay.

I want to know whether the product names from column D are contained in the titles from column A. The result to appear in column B, as shown below.

1660044415772.png


I tried using MATCH, SEARCH, XVLOOKUP and combinations thereof but none delivered the result I am looking for.

I am using Excel for Microsoft 365 Version 2202.

Thank you very much for your help.
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Might I ask, what is the actual result you are looking for ? Is it just a TRUE/FALSE in say Column C for each row ?

thanks

Rob
 
Upvote 0
How about
Excel Formula:
=FILTER($D$2:$D$7,ISNUMBER(SEARCH($D$2:$D$7,A2)),"N/A")
 
Upvote 0
Hi @RobP !
Might I ask, what is the actual result you are looking for ? Is it just a TRUE/FALSE in say Column C for each row ?
Yes, of course! I am trying to identify which product (amongst the ones indicated in Column D) is being mentioned in each "Title" cell. Column C can be left empty.

Hi @Fluff !
How about
Excel Formula:
=FILTER($D$2:$D$7,ISNUMBER(SEARCH($D$2:$D$7,A2)),"N/A")
This works! Amazing!

Just one added question, in some cases the formula delivers a "#SPILL" error. I thought this happened when more than 1 value from the D Column is available in the same "Advertisement Title" cell. However, after some testing, this does not seem to be the case.

For example:

1660050414979.png


Is there any way to avoid this?

Thanks again!
 
Upvote 0
However, after some testing, this does not seem to be the case.
That is the case. B13 & B14 returns A40 and A40 TR, whilst B12 returns A40 and MixAmp pro.

What should happen in those cases?
 
Upvote 0
What should happen in those cases?

You are right!

Ideally, the more "Specific" value should be rendered.

So between A40 and A40 TR, A40 TR should be given.
 
Upvote 0
A formula does not know which value is more "specific".
Do you want to return all matches?
 
Upvote 0
Ok, how about
Excel Formula:
=TEXTJOIN(", ",,FILTER($O$3:$O$5,ISNUMBER(SEARCH($O$3:$O$5,L3)),"N/A"))
 
Upvote 0
Solution

Forum statistics

Threads
1,214,652
Messages
6,120,747
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top