Searching for a "text" in a long text cell

zaducu

New Member
Joined
Aug 1, 2013
Messages
4
Hello guys and girls,

I just arrived on this forum and I think it is the best Excel community I've discovered until now. I am currently having an Excel issue. I have a table with mentions of a specific car brand from social media channels. I have to analyse the discussions and show the number of time a specific model of the car has been mentioned in all the mentions that are collected.

Below you can see more exactly what I want to achieve.

Brand mentionsModel A90Model B60Model C30
Lorem ipsum A90100
Lorem ipsum a 90 text text100
A 90 more text more text100
asdfa B 60 asdas asd010
b 60 text text text010
sad C30 bag001
asdasd c30.001
asdas dadsda sda000

<tbody>
</tbody>

There are 2 issues I don't know how to solve:
  • The text from the first coloumn is including the value but not alone. So COUNTIF or VLOOKUP didn't helped me, or I didn't knew how to set them.
  • I want to search for more than one value (so not only search for A90 but search for "A90" AND "A 90" AND "a90" AND "a 90")

I would really appreciate your help. I hope I was clear.

Thank you!
Alex
 
Last edited:

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
I put the following formula in cell B2, then copied to the entire area:

Code:
=IF(ISERROR(SEARCH(RIGHT(B$1,3),SUBSTITUTE($A2," ",""))),0,1)
 
Upvote 0
Hello JLeno, thank you very much for your answer. It used your formula but it seems that it has some issue. For example I have the model ABC2000 but it gives value 1 to all the text which include 2000, so for example "When i first got the car 20 000 road" is marked as 1.
 
Upvote 0
The formula searches for the last three characters of the top row (e.g. A90, B90, etc.) So if there is a ABC2000 it searches for all texts that contain "000".

I would suggest you include an extra row with just the model number, without "Model" in front of it, in row 2. Then change the formula to

Code:
=IF(ISERROR(SEARCH(B$2,SUBSTITUTE($A3," ",""))),0,1)
 
Upvote 0
The problem is that some models don't follow the pattern so their format are either "PV832" OR "Word Word" OR "WORD WORD C40". Do you know if there are any other solutions? Thank you very much for your help and time.
 
Upvote 0
Well if you have put the model names on the separate row, you can amend the formula like this:


Code:
=IF(AND(ISERROR(SEARCH(B$2,SUBSTITUTE($A3," ",""))),ISERROR(SEARCH(B$2,$A3))),0,1)
 
Upvote 0
Well if you have put the model names on the separate row, you can amend the formula like this:


Code:
=IF(AND(ISERROR(SEARCH(B$2,SUBSTITUTE($A3," ",""))),ISERROR(SEARCH(B$2,$A3))),0,1)


I've eliminated the car model which included only words so now I have models like C60, C360, xc90. But I need to keep the letters because there are models like C60 and XC60. So if I would leave only 60 it will take both models.
 
Upvote 0

Forum statistics

Threads
1,215,578
Messages
6,125,642
Members
449,245
Latest member
PatrickL

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