Index/Match - Return value if partial text from cell contained in separate column

excelnewb221

New Member
Joined
Dec 14, 2022
Messages
14
Office Version
  1. 365
Platform
  1. Windows
Hello,

Hoping for some help. Unfortuanately the Xl2bb Addin is disabled on my computer by Admin access.

I have 2 columns.
Column A, contains the source data. This column contains a string of words.
Column B will contain the formula.
Column C contains a string of words. These values may or may not be in Column A.
However, if any word from the cell in column C, matches any word from a cell in column A, please return that value from column A, next to its respective cell from column C.

This is basically what I'm trying to accomplish:
Data (column A)Formula (column B)Original Value (column C)Formula will produce:
Apple Carrot OrangeOrange CarrotApple Carrot Orange
Beet Tomato OnionTomatoBeet Tomato Onion
Pepper Banana GrapeGrape JuicePepper Banana Grape
Lettuce Kale ChiaKale Spinach BroccoliLettuce Kale Chia
Apple Carrot OrangeOrange CarrotApple Carrot Orange
Beet Tomato OnionBeet JuiceBeet Tomato Onion
Pepper Banana GrapeStrawberryN/A
Lettuce Kale ChiaKaleLettuce Kale Chia
Apple Carrot OrangeOrangeApple Carrot Orange
Beet Tomato OnionJuiceN/A


And below are the terrible attempts I've made. I clearly don't know how to make this work.
Not really sure the best approach to take, so hoping someone could help guide me in that regard.
Please let me know what is needed to better articulate what I'm trying to achieve. Really appreciate any help.

DataFormula Column Formula WrittenOriginal ValueValue for Formula to WorkProblem
Apple Carrot OrangeBeet Tomato OnionINDEX(A2:A5,MATCH(E2,A2:A5))Orange CarrotOrange CarrotIndex/Match - returns value from 2nd row?
Beet Tomato OnionBeet Tomato OnionVLOOKUP(E3&"*",A:A,1,FALSE)Beet JuiceBeetVlookup - only returns if first word matches?
Pepper Banana GrapePepper Banana GrapeVLOOKUP(E4&"*"&"*",A:A,1,FALSE)Grape JuicePepperVlookup - only returns if first word matches?
Lettuce Kale ChiaLettuce Kale ChiaINDEX(A2:A5,MATCH("*"&E5,A2:A5,0))Kale Spinach BroccoliChiaIndex/Match - only returns if last word matches
Apple Carrot Orange
0​
XLOOKUP(TRUE,ISNUMBER(SEARCH(D6:D9,A6)),D6:D9,0)Orange Carrot
Beet Tomato Onion
0​
FILTER(D6:D9,ISNUMBER(SEARCH(D6:D9,A6)),0)Beet Juice
Pepper Banana Grape
#N/A​
MATCH(TRUE,ISNUMBER(SEARCH(D6:D9,A6)),0)Grape Juice
Lettuce Kale Chia
#N/A​
XLOOKUP("*"&D9&"*",A6:A9,A6:A9,,2)Kale Spinach BroccoliOnly works if column C contains one word
Apple Carrot Orange
#N/A​
INDEX(A7:A10,MATCH("*"&D10,A7:A10,0))Apple Orange
Beet Tomato Onion
#N/A​
INDEX(A8:A11,MATCH("*"&D11&"*",A8:A11,0))Beet Juice
 
From your posted example, what would you expect the results to be?
It would be helpful if you re-post and example and expected results (again, please use XL2BB).
 
Upvote 0

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Yes, you are correct kweaver. I will repost, but the addin doesn’t work in my computer.
Sorry for the trouble.
 
Upvote 0
Use the same approach as you did before. Just don't send a picture (jpg, etc.). Those are useless, frankly.
 
Upvote 0
Is there a way to have the formula search all throughout column A? And if there is a match, then it returns the respective value that it found in column A.


So, assuming the following:
Dante Amor
ABC
1DataFormulaOriginal Value
2Apple Carrot OrangeApple Carrot OrangeOrange Carrot
3Beet Tomato OnionBeet Tomato OnionTomato
4Pepper Banana GrapePepper Banana GrapeGrape Juice
5Lettuce Kale ChiaLettuce Kale ChiaKale Spinach Broccoli
6Apple Carrot OrangeOrange Carrot
7Beet Tomato OnionBeet Juice
8#VALOR!Strawberry
9Lettuce Kale ChiaKale
10Apple Carrot OrangeOrange
11#VALOR!Juice
Sheet


Put this formula in cell B2 (No need to copy down.)
Excel Formula:
=LET(a,A2:A5,BYROW(C2:C11,LAMBDA(bx,INDEX(a,UNIQUE(MAX(IFERROR(BYROW(TEXTSPLIT(bx,," "),LAMBDA(br,MATCH("*"&br&"*",a,0))),-ROW($A$1))))+ROW($A$1)-1))))
Adjust A2:A5 for the cells that have the Data and C2:C11 for Original value.

--------------
Let me know the result and I'll get back to you as soon as I can.
Cordially
Dante Amor
--------------​
 
Upvote 1
工作簿2
ABCD
1Data (column A)Try this:Original Value (column C)Formula will produce:
2Apple Carrot OrangeBeet Tomato OnionBeet JuiceBeet Tomato Onion
3Beet Tomato OnionPepper Banana GrapeGrape JuicePepper Banana Grape
4Pepper Banana Grape#N/AJuiceN/A
5Lettuce Kale ChiaLettuce Kale ChiaKaleLettuce Kale Chia
6Apple Carrot OrangeLettuce Kale ChiaKale Spinach BroccoliLettuce Kale Chia
7Beet Tomato OnionApple Carrot OrangeOrangeApple Carrot Orange
8Pepper Banana GrapeApple Carrot OrangeOrange CarrotApple Carrot Orange
9Lettuce Kale ChiaApple Carrot OrangeOrange CarrotApple Carrot Orange
10Apple Carrot Orange#N/AStrawberryN/A
11Beet Tomato OnionBeet Tomato OnionTomatoBeet Tomato Onion
Sheet4
Cell Formulas
RangeFormula
B2:B11B2=LOOKUP(1,0/BYROW(N(ISNUMBER(FIND(TEXTSPLIT(C2," "),A$2:A$11))),LAMBDA(x,SUM(x))),A$2:A$11)
 
Upvote 1
Or if you don't have lambda, try this
工作簿2
ABCD
1Data (column A)Try thisOriginal Value (column C)Formula will produce:
2Apple Carrot OrangeBeet Tomato OnionBeet JuiceBeet Tomato Onion
3Beet Tomato OnionPepper Banana GrapeGrape JuicePepper Banana Grape
4Pepper Banana Grape#N/AJuiceN/A
5Lettuce Kale ChiaLettuce Kale ChiaKaleLettuce Kale Chia
6Apple Carrot OrangeLettuce Kale ChiaKale Spinach BroccoliLettuce Kale Chia
7Beet Tomato OnionApple Carrot OrangeOrangeApple Carrot Orange
8Pepper Banana GrapeApple Carrot OrangeOrange CarrotApple Carrot Orange
9Lettuce Kale ChiaApple Carrot OrangeOrange CarrotApple Carrot Orange
10Apple Carrot Orange#N/AStrawberryN/A
11Beet Tomato OnionBeet Tomato OnionTomatoBeet Tomato Onion
Sheet4
Cell Formulas
RangeFormula
B2:B11B2=LOOKUP(1,0/MMULT(N(ISNUMBER(FIND(TEXTSPLIT(C2," "),A$2:A$11))),ROW(INDIRECT("1:"&COUNTA(TEXTSPLIT(C2," "))))^0),A$2:A$11)
 
Upvote 1

Forum statistics

Threads
1,224,813
Messages
6,181,107
Members
453,021
Latest member
Justyna P

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