compare 2 cels that contain certain text

gyagos

New Member
Joined
Mar 27, 2018
Messages
27
Office Version
  1. 365
Platform
  1. Windows
All,
I am trying to figure out how to go about this. I need to add a column and if Column "E" contains the word Printer and column "D" contains "OWB", i need to display "OWB PRINTER". If it doesnt match than i can just put "OTHER
Some examples below.

Column "D" Column "E"
OWB Workstations CrownKonica Minolta Printer/Fax/Scanner

<tbody>
</tbody>
OWB Workstations West CovinaHP JetDirect Printer

<tbody>
</tbody>
OWB Workstations AustinRicoh Aficio/IPSiO Network Printer

<tbody>
</tbody>
OWB Bank BranchesHP JetDirect Printer

<tbody>
</tbody>


Thanks in advance
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Hi & welcome to MrExcel.
How about
Code:
Sub OWBPrinters()
   Range("F:F").Insert
   With Range("F2", Range("E" & Rows.Count).End(xlUp).Offset(, 1))
      .Value = Evaluate(Replace(Replace("IF(ISNUMBER(SEARCH(""OWB"",@d))*ISNUMBER(SEARCH(""Printer"",@e)),""OWB Printer"",""Other"")", "@d", .Offset(, -2).Address), "@e", .Offset(, -1).Address))
   End With
End Sub
 
Upvote 0
Thank you for the quick response. Works like a charm
 
Upvote 0
Glad to help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,215,523
Messages
6,125,318
Members
449,218
Latest member
Excel Master

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