Link to home
Start Free TrialLog in
Avatar of Buck Beasom
Buck BeasomFlag for United States of America

asked on

Conditional Formatting with VLOOKUP

I am using VLookup to pull values in from one Excel tab to another. I want to make the cell change color if the user manually types in a value to replace the VLOOKUP value. So, for example, if the user goes into Cell B2 on the tab with the VLOOKUP value of "Joe" and types in "Jack" instead, I want the cell to change color so the user can see what they have changed.

I've tried this as a conditional formatting test: ="VLOOKUP(A2,SEG_D1!A:B,2,FALSE)<>B2"

The first part yields the original value and is the formula in Cell B2. If the user types over this value and puts something else in there than what the VLOOKUP yields, I want the cell to change color. Looks to me like the above would apply the test between what the VLOOKUP is yielding and what is actually in Cell B2. But when I change the value in B2 manually, it doesn't change color.

Any suggestions appreciated.

Thanks.
Avatar of Ejgil Hedegaard
Ejgil Hedegaard
Flag of Denmark image

You can't reference another sheet in a conditional format formula.

But with a named range it is possible.
Name columns A:B on the sheet SEG_D1 LookupRange
Then use the name in the Vlookup formula like this =VLOOKUP(A2,LookupRange,2,FALSE)<>B2
Avatar of Buck Beasom

ASKER

Seems like it should work. I named the range "RPTID" in the SEG_D1 tab and the VLOOKUP works, but when I put this into the conditional format:

="VLOOKUP(A2,RPTID,2,FALSE)<>B2"

It still doesn't change color when I change the B2 value.

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of Ejgil Hedegaard
Ejgil Hedegaard
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Awesome! That's got it! THANKS!