filling cell with a specific text if another cell contains any of the specific keywords

Excel Learner007

New Member
Joined
Feb 26, 2011
Messages
18
Hi Everyone,
We have a huge sheet (almost 40k Rows). Now, there is a column "Short Description" and based on the keywords in that column, we need to categorize it as either CPU, Memory, Disk, Database or Storage. Below is the categorization. Would be great if someone can help.

OtherCPUMemoryDiskDatabaseStorage
aixcorepagingmountmssqlStorage
bioswaitheapdataoracleSpace
clusterCachepagefilesystemsql
esxdelayramdrivesybase
ratehandlerswapnfssybdump
linuxperformancetempread
nodesprocessorthresholdstorage
slowqueuetimeoutwrite
unixstatsvol
windows
vmware
vsphere
vmtools
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
I would make your list above a two column lookup reference table, i.e. Value and Category.
Then you can use a VLOOKUP function to look up the category for each record in your main table.
See here: MS Excel: How to use the VLOOKUP Function (WS)
I'm trying it using IF , below is the formula.. If I do it only for 1 item, say CPU, it works, but won't if I will add all, maybe I'm not doing it right, can you correct me?

=IF(OR(ISNUMBER(SEARCH("core",I2)),ISNUMBER(SEARCH("wait",I2)),ISNUMBER(SEARCH(“Cache”,I2)), ISNUMBER(SEARCH(“delay”,I2)), ISNUMBER(SEARCH(“handler”,I2)), ISNUMBER(SEARCH(“performance”,I2)), ISNUMBER(SEARCH(“processor”,I2)), ISNUMBER(SEARCH(“queue”,I2)), ISNUMBER(SEARCH(“stats”,I2))),"CPU",(OR(ISNUMBER(SEARCH("paging",I2)),ISNUMBER(SEARCH("heap",I2)),ISNUMBER(SEARCH(“page”,I2)), ISNUMBER(SEARCH(“ram”,I2)), ISNUMBER(SEARCH(“swap”,I2)), ISNUMBER(SEARCH(“temp”,I2)), ISNUMBER(SEARCH(“threshold”,I2)), ISNUMBER(SEARCH(“timeout”,I2)),"MEMORY",(OR(ISNUMBER(SEARCH("mount",I2)),ISNUMBER(SEARCH("data",I2)),ISNUMBER(SEARCH(“filesystem”,I2)), ISNUMBER(SEARCH(“drive”,I2)), ISNUMBER(SEARCH(“nfs”,I2)), ISNUMBER(SEARCH(“read”,I2)), ISNUMBER(SEARCH(“storage”,I2)), ISNUMBER(SEARCH(“write”,I2)), ISNUMBER(SEARCH(“volume”,I2)),"DISK",(OR(ISNUMBER(SEARCH("mssql",I2)),ISNUMBER(SEARCH("oracle",I2)),ISNUMBER(SEARCH(“sql”,I2)), ISNUMBER(SEARCH(“sybase”,I2)), ISNUMBER(SEARCH(“sybdump”,I2)),”DATABASE”,(OR ISNUMBER(SEARCH(“Storage”,I2)), ISNUMBER(SEARCH(“space”,I2)), “STORAGE", “NA”))
 
Upvote 0
I would never attempt to use a formula like that. That is a behemoth and a nightmare, and will be a pain to maintain if you ever have additions/removals from your data lists.

Like I said, I would recommend creating a two column lookup table that starts like this:
1646832595907.png


And then use a LOOKUP value to find the Category to return, i.e.
Excel Formula:
=VLOOKUP(I2,A:B,2,0)
 
Upvote 0
I would never attempt to use a formula like that. That is a behemoth and a nightmare, and will be a pain to maintain if you ever have additions/removals from your data lists.

Like I said, I would recommend creating a two column lookup table that starts like this:
View attachment 59635

And then use a LOOKUP value to find the Category to return, i.e.
Excel Formula:
=VLOOKUP(I2,A:B,2,0)
this didn't work, as Vlookup will search for exact match, cell I2 can contain more than one word, for example " Backup failed for below devices SYD01 :Daily_Backup_App_scsydprpsnt03gmt_snppum04"
 
Upvote 0
this didn't work, as Vlookup will search for exact match, cell I2 can contain more than one word, for example " Backup failed for below devices SYD01 :Daily_Backup_App_scsydprpsnt03gmt_snppum04"
OK, since you did not provide any sample data in your original post, that criteria was not clear.

Not sure the best way to go about that. If it were me, I might look at a VBA solution, but still having that two column reference table to look for.

And does the possibility exist that TWO or more of those words might appear in a single entry?
 
Upvote 0
OK, since you did not provide any sample data in your original post, that criteria was not clear.

Not sure the best way to go about that. If it were me, I might look at a VBA solution, but still having that two column reference table to look for.

And does the possibility exist that TWO or more of those words might appear in a single entry?
Yes, there is a possibility that 2 or more words might appear in the cell
 
Upvote 0
Would you consider a VBA solution?
 
Upvote 0
Would you consider a VBA solution?
I can, would it work if I have to extract new data every week for different regions? the format of the data would remain the same.

Below are the columns, the last 2 in bold is what I have to insert, Month should fetch the month name from date column and Category should fetch the Category from the grid based on the keywords in Short Description column, if no matching keyword is found it should say "Not Found"

Thanks again for a quick response and help!!

Ticket NumberTicket StatusAssigned ToAccount NameDateTicket PriorityShort DescriptionAssignment GroupMonthCategory
 
Upvote 0
I assume that already know how to return the Month from the Date (you could simply just return the whole date and format the columns to "mmmm" or you could use the TEXT function).
Can you provide more details where everything exists?
Specifically,
- What is the sheet name that this data will appear on?
- What range exactly, is the header row you show in your previous post located?
- Is your list of categories to look up in the same file?
- What is the name of the sheet this category list appears on?
 
Upvote 0

Forum statistics

Threads
1,215,588
Messages
6,125,691
Members
449,250
Latest member
azur3

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