comparing cells and copying data based on match or failure

Gnome

New Member
Joined
Jun 29, 2022
Messages
4
Office Version
  1. 2010
Platform
  1. Windows
Hi all,
I'm not even sure how to start this one - I'll do my best to explain.
I have one worksheet called "sheet1" and it contains the below data

TitleUser NameStatus
Backup123_nissanseed
AuthenticationABCDEF\123_subwaywilderness
misc.123_hyundaicomedy
copyabc\123_samsungminnow

I then have "sheet2" which contains the following
TitleUser NameStatus
BackupOn
Authentication123_subwaywildernessOff
misc.123_hyundaicomedyOn
copy123_samsungminnowOn


Is there a way I can search the username field in sheet2 and if it matches sheet1 - highlight the cell green in sheet 1 and copy the status field across also.

The ***\ only exists in sheet1 and can be ignored, it’s the second half that will match and 123_will be always be there in both sheets

If no match is found, the cell in sheet1 needs to be highlighted red.
The examples in username isn't exhaustive and updates... is this a possible thing to achieve?
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
perhaps easier - if anything in sheet1 column A matches with anything in sheet2 column B then copy value from column C ( next cell over) back to sheet1 column B
 
Upvote 0
I hope i understand right. try this one.

1659702974238.png
 
Upvote 0
In order to higlight the found entries on Sheet 1 green, assuming that your data starts up in cell A1 on each sheet, do the following:
1. On Sheet1, select cell B2 down to the botton of column B
2. Go to Conditional Formatting
3. Select the "New Rule" option
4. Select the "Use a formula to determine which cells to format" option
5. Enter in the following formula:
Excel Formula:
=COUNTIF(Sheet2!$B:$B,$B2)>0
6. Choose the green formatting option
7. Click OK.

Then, to highlight the unfound ones red, follow the exact same steps, except use this formula in step 5:
Excel Formula:
=COUNTIF(Sheet2!$B:$B,$B2)=0
and choose the red formatting option.

Then, to bring back the status in column C, enter this formula in cell C2 on Sheet1 and copy down for all rows:
Excel Formula:
=IFERROR(VLOOKUP($B2,Sheet2!B:C,2,0),"")
 
Upvote 0

Forum statistics

Threads
1,223,883
Messages
6,175,167
Members
452,615
Latest member
bogeys2birdies

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