Text function

Sid_2987

New Member
Joined
Jun 28, 2016
Messages
17
I'm having a group of keywords which I want to match with in particular text.

Below is the example.

ListItem
I love appleappleapple
Apple is sweet fruitapplebanana
Banana is rich in carbohydratebananawatermelon
apple / banana comes in fruit categorybananaCherry
banana / watermelon is my favoritewatermelon
watermelon / cherry / apple is nice for healthCherry

<colgroup><col><col span="3"></colgroup><tbody>
</tbody>

<colgroup><col><col></colgroup><tbody>
</tbody>

Here I am writing my function to get the matching result. "=LOOKUP(2^15,SEARCH(fruit,A3),fruit)" where fruits : apple, banana, watermelon & cherry.

Question: Is there anyway to write a function so that I can get the first fruit name appearing in list (Bold fruit name)?
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Hi Thanks Jonmo1,

I tried with your formula but is not working. SEARCH function taking keyword array based on the order.

List ItemFruit1
I love appleapplewatermelon
Apple is sweet fruitapplecherry
Banana is rich in carbohydratebananabanana
apple / banana comes in fruit categorybananaapple
banana / watermelon is my favoritewatermelon
watermelon / cherry / apple is nice for healthwatermelon
watermelon watermelon
watermelon / applewatermelon

<colgroup><col><col span="3"></colgroup><tbody>
</tbody>

Can you try it once?
 
Upvote 0
You said
Is there anyway to write a function so that I can get the first fruit name appearing in list (Bold fruit name)?

I took that to mean you wanted the one that appears first in the range named 'fruit'

Given below example,
A5 has both apple and banana in the cell.
But banana appears first in the fruit list, so the formula returns banana.

A6 has both banana and watermelon in the cell.
But watermelon appears first in the fruit list, so the formula returns watermelon.


Unknown
ABCD
1ListItemFruit1
2I love appleapplewatermelon
3Apple is sweet fruitapplecherry
4Banana is rich in carbohydratebananabanana
5apple / banana comes in fruit categorybananaapple
6banana / watermelon is my favoritewatermelon
7watermelon / cherry / apple is nice for healthwatermelon
8watermelonwatermelon
9watermelon / applewatermelon
Sheet1
Cell Formulas
RangeFormula
B2=INDEX(fruit,MATCH(TRUE,INDEX(ISNUMBER(SEARCH(fruit,A2)),0),0))
B3=INDEX(fruit,MATCH(TRUE,INDEX(ISNUMBER(SEARCH(fruit,A3)),0),0))
B4=INDEX(fruit,MATCH(TRUE,INDEX(ISNUMBER(SEARCH(fruit,A4)),0),0))
B5=INDEX(fruit,MATCH(TRUE,INDEX(ISNUMBER(SEARCH(fruit,A5)),0),0))
B6=INDEX(fruit,MATCH(TRUE,INDEX(ISNUMBER(SEARCH(fruit,A6)),0),0))
B7=INDEX(fruit,MATCH(TRUE,INDEX(ISNUMBER(SEARCH(fruit,A7)),0),0))
B8=INDEX(fruit,MATCH(TRUE,INDEX(ISNUMBER(SEARCH(fruit,A8)),0),0))
B9=INDEX(fruit,MATCH(TRUE,INDEX(ISNUMBER(SEARCH(fruit,A9)),0),0))
Named Ranges
NameRefers ToCells
fruit=Sheet1!$D$2:$D$5
 
Upvote 0
Hi Jonmo1,

Basically I mentioned List as attribute. Marked as in Bold Letter. Also I have Item (as output of formula). So from List attribute I want bold letter into Item column.

ListItemFruit1
I love appleapplewatermelon
Apple is sweet fruitapplecherry
Banana is rich in carbohydratebananabanana
apple / banana comes in fruit categoryappleapple
banana / watermelon is my favoritebanana
watermelon / cherry / apple is nice for healthwatermelon
watermelon / applewatermelon

<colgroup><col><col span="3"></colgroup><tbody>
</tbody>

Can this is possible?
 
Upvote 0
Try
=MID(A2,AGGREGATE(15,6,SEARCH(fruit,A2),1),FIND(" ",A2&" ",AGGREGATE(15,6,SEARCH(fruit,A2),1))-AGGREGATE(15,6,SEARCH(fruit,A2),1))

It's ugly, but works.
I've been unable to come up with anything simpler.
Seems like it would be easier than that though.
 
Upvote 0
Thankyou Jonmo1. I will check it tomorrow. Thanks for your support and keeping patience for my query.
 
Upvote 0
Cross-posted: Text function

While we do not prohibit Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule #13 here: Forum Rules).

This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.

For a more complete explanation on cross-posting, see here: Excelguru Help Site - A message to forum cross posters).
 
Upvote 0

Forum statistics

Threads
1,215,375
Messages
6,124,578
Members
449,174
Latest member
chandan4057

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