Formula to Retrieve Value base on specific text.

Kingkoopa

Board Regular
Joined
Aug 7, 2014
Messages
94
Hi Guys,

I am using Excel 2016. Its been awhile since I posted would appreciate some help on the following problem. :(

I have the following list :

[TABLE="width: 200"]
<tbody>[TR]
[TD]Fruit[/TD]
[TD]Price[/TD]
[/TR]
[TR]
[TD]Apple[/TD]
[TD]5.00[/TD]
[/TR]
[TR]
[TD]Watermelon[/TD]
[TD]6.00[/TD]
[/TR]
[TR]
[TD]Mango[/TD]
[TD]4.50[/TD]
[/TR]
</tbody>[/TABLE]

[TABLE="width: 214"]
<tbody>[TR]
[TD]Fruit[/TD]
[TD]Price[/TD]
[/TR]
[TR]
[TD]Watermelone 5KG[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Banana 300G[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Red Apple 300G[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Mango 2.50KG[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Green Apple 200G[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Mango 10KG[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Watermelone 500G[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Pear 5KG[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


Would like to get the following result :

[TABLE="width: 214"]
<tbody>[TR]
[TD]Fruit[/TD]
[TD]Price[/TD]
[/TR]
[TR]
[TD]Watermelone 5KG[/TD]
[TD] 6.00[/TD]
[/TR]
[TR]
[TD]Banana 300G[/TD]
[TD]#N/A[/TD]
[/TR]
[TR]
[TD]Red Apple 300G[/TD]
[TD] 5.00[/TD]
[/TR]
[TR]
[TD]Mango 2.50KG[/TD]
[TD] 4.50[/TD]
[/TR]
[TR]
[TD]Green Apple 200G[/TD]
[TD] 5.00[/TD]
[/TR]
[TR]
[TD]Mango 10KG[/TD]
[TD] 4.50[/TD]
[/TR]
[TR]
[TD]Watermelone 500G[/TD]
[TD] 6.00[/TD]
[/TR]
[TR]
[TD]Pear 5KG[/TD]
[TD]#N/A[/TD]
[/TR]
</tbody>[/TABLE]


Basically if the text is found in the table it would list the corresponding price. Been messing around with a lot of lookup, search, countif combination of formula's. But can't seem to figure out a way to get the price :(.
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
How about


Book1
ABCDEF
1FruitPriceFruitPrice
2Apple5Watermelone 5KG6
3Watermelon6Banana 300G0
4Mango4.5Red Apple 300G5
5Mango 2.50KG4.5
6Green Apple 200G5
7Mango 10KG4.5
8Watermelone 500G6
9Pear 5KG0
Test
Cell Formulas
RangeFormula
F2=SUMPRODUCT((ISNUMBER(SEARCH($A$2:$A$4,E2)))*($B$2:$B$4))
 
Last edited:
Upvote 0
Or............

In F2, copied down :

=LOOKUP(1,-FIND($A$2:$A$4,E2),$B$2:$B$4)

Regards
 
Upvote 0
Glad we could help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,229
Messages
6,170,881
Members
452,364
Latest member
springate

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