Find Specific Text from Data Source - If cell contains certain wording have a different output.

LikeablePringle

New Member
Joined
Aug 19, 2022
Messages
3
Office Version
  1. 365
Platform
  1. Windows
So I am Struggling with finding a way to have a formula that will search column C for certain words that will then categorise them into column D.

For example with the text cell C2 contains "Zoom" Cell D2 = Software, Cell C3 contains Zipcar cell D3 = Travel, C4 Contains " Voxi", D4 = Telephone.

At the moment i am using drop down menus but going through a large amount of data makes this very time consuming.
This will need to be able to contain a multitude of inputs and outputs but just can't wrap my head around the formula needed.

Thank you!
 

Attachments

  • 2022-08-19_09-21-07.png
    2022-08-19_09-21-07.png
    10.6 KB · Views: 3

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
You're want to use XLOOKUP(VLOOKUP would also work, but I like using the former since it can be a lot more flexible :))
Book1
ABCDE
1Column CThe Output you wantLookup ArrayReturn Array
2ZoomSoftwareZoomSoftware
3Zipcar TravelZipcar Travel
4ZoomSoftwareVoxiTravel
5ZoomSoftware
6VoxiTravel
7VoxiTravel
8ZoomSoftware
9Zipcar Travel
10VoxiTravel
Sheet1
Cell Formulas
RangeFormula
B2:B10B2=XLOOKUP(A2,$D$1:$D$4,$E$1:$E$4,"Nothing defined in the Return Array for this Lookup Value")
 
Upvote 0
You're want to use XLOOKUP(VLOOKUP would also work, but I like using the former since it can be a lot more flexible :))
Book1
ABCDE
1Column CThe Output you wantLookup ArrayReturn Array
2ZoomSoftwareZoomSoftware
3Zipcar TravelZipcar Travel
4ZoomSoftwareVoxiTravel
5ZoomSoftware
6VoxiTravel
7VoxiTravel
8ZoomSoftware
9Zipcar Travel
10VoxiTravel
Sheet1
Cell Formulas
RangeFormula
B2:B10B2=XLOOKUP(A2,$D$1:$D$4,$E$1:$E$4,"Nothing defined in the Return Array for this Lookup Value")
Thank you for that.

The issue i am having though is that i also need to search within the A column to identify if the key words are there.
As its bank statements there are multiple words in the Cell rather than just Zoom for example. Are we able to search for a specific word in column A then use an X lookup if said word is present?
 
Upvote 0
Thank you for that.

The issue i am having though is that i also need to search within the A column to identify if the key words are there.
As its bank statements there are multiple words in the Cell rather than just Zoom for example. Are we able to search for a specific word in column A then use an X lookup if said word is present?
The solution I came up with is a bit clunky, but works. If you could post the sheet you're dealing with here it might be a bit easier to help :)
Book2
ABCDE
1Your ListThe output you wantYour KeywordsCategories for those keywords
2zoom.comSoftwarezoomSoftware
3zipcar.ukTravelzipcarTravel
4www.Zoom.atSoftwarevoxiTelephone
5https://voxi.comTelephone
6VOXI.ggTelephone
7www.ZipCar.comTravel
8https://Zoom.ggSoftware
Sheet1
Cell Formulas
RangeFormula
B2:B8B2=IF(ISNUMBER(SEARCH($D$2,A2)),$E$2, IF(ISNUMBER(SEARCH($D$3,A2)),$E$3, IF(ISNUMBER(SEARCH($D$4,A2)),$E$4, )))

Also, apologies, the response I posted earlier was COMPLETELY wrong. The issue is, I realised much later and by then, I could no longer edit or delete that post. This solution should ideally work, but it assumes you have a very short list of keywords that you're looking for. the longer your list, the uglier the formula becomes.

I know there is a way to implement this more elegantly using some fancy array formulas, but I can't get it to work. The only other idea I have would be to use VBA.
 
Last edited:
Upvote 0
Solution
The solution I came up with is a bit clunky, but works. If you could post the sheet you're dealing with here it might be a bit easier to help :)
Book2
ABCDE
1Your ListThe output you wantYour KeywordsCategories for those keywords
2zoom.comSoftwarezoomSoftware
3zipcar.ukTravelzipcarTravel
4www.Zoom.atSoftwarevoxiTelephone
5https://voxi.comTelephone
6VOXI.ggTelephone
7www.ZipCar.comTravel
8https://Zoom.ggSoftware
Sheet1
Cell Formulas
RangeFormula
B2:B8B2=IF(ISNUMBER(SEARCH($D$2,A2)),$E$2, IF(ISNUMBER(SEARCH($D$3,A2)),$E$3, IF(ISNUMBER(SEARCH($D$4,A2)),$E$4, )))

Also, apologies, the response I posted earlier was COMPLETELY wrong. The issue is, I realised much later and by then, I could no longer edit or delete that post. This solution should ideally work, but it assumes you have a very short list of keywords that you're looking for. the longer your list, the uglier the formula becomes.

I know there is a way to implement this more elegantly using some fancy array formulas, but I can't get it to work. The only other idea I have would be to use VBA.
That worked!

Your right about it being a bit of a faff working with a large keyword list - but i have been playing around with it and it works better than anything i could manage!

Thank you so much for your help :)
 
Upvote 0

Forum statistics

Threads
1,214,879
Messages
6,122,065
Members
449,064
Latest member
scottdog129

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