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"
[TABLE="width: 763"]
<tbody>[TR]
[TD="width: 294"]OWB Workstations Crown[/TD]
[TD="width: 469"]Konica Minolta Printer/Fax/Scanner[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 763"]
<tbody>[TR]
[TD="width: 294"]OWB Workstations West Covina[/TD]
[TD="width: 469"]HP JetDirect Printer[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 763"]
<tbody>[TR]
[TD="width: 294"]OWB Workstations Austin[/TD]
[TD="width: 469"]Ricoh Aficio/IPSiO Network Printer[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 763"]
<tbody>[TR]
[TD="width: 294"]OWB Bank Branches[/TD]
[TD="width: 469"]HP JetDirect Printer[/TD]
[/TR]
</tbody>[/TABLE]


Thanks in advance
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
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
Glad to help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,721
Messages
6,174,091
Members
452,542
Latest member
Bricklin

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