Conditional formatting based on data from another sheet

Mux99

Board Regular
Joined
Apr 15, 2019
Messages
57
Hi all

I would like to highlight cells, based on data from another sheet if the text in column A matches.

Sheet1 contains data with names in column A.
Sheet2 also contains data with names but in a different order and some will be listed multiple times so these would all need to be highlighted.

Sheet1ABCDE
1apple
2orangeXX
3peachXX
4bananaX
5melon

Sheet2ABCDE
1melon
2orangeHIGHLIGHTHIGHLIGHT
3peachHIGHLIGHTHIGHLIGHT
4orangeHIGHLIGHTHIGHLIGHT
5apple
6peachHIGHLIGHTHIGHLIGHT
7bananaHIGHLIGHT
8orangeHIGHLIGHTHIGHLIGHT
9apple

Thanks in advance
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Select your data from sheet1 and create a named range, let's say: Fruits.

On sheet2 select cell B2.
In conditional format put this formula:
=VLOOKUP($A2,Fruits,COLUMN(),0)="X"

Select format color.

In Referes to:
=$B$2:$E$10

varios 08jul2020.xlsm
ABCDE
1FruitH1H2H3H4
2melon
3orange
4peach
5orange
6apple
7peach
8banana
9orange
10apple
Sheet2
 
Upvote 0
Select your data from sheet1 and create a named range, let's say: Fruits.

On sheet2 select cell B2.
In conditional format put this formula:
=VLOOKUP($A2,Fruits,COLUMN(),0)="X"

Select format color.

In Referes to:
=$B$2:$E$10

varios 08jul2020.xlsm
ABCDE
1FruitH1H2H3H4
2melon
3orange
4peach
5orange
6apple
7peach
8banana
9orange
10apple
Sheet2

Thanks. Worked perfectly
 
Upvote 0
I'm glad to help you. Thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,983
Messages
6,122,595
Members
449,089
Latest member
Motoracer88

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