Conditional Format alternative

johnmpc

Board Regular
Joined
Oct 19, 2020
Messages
108
Office Version
  1. 365
Platform
  1. Windows
Hi,

I know that Conditional formatting doesn't carry over when using a Vlookup.

I am using a Vlookup to search data on a different sheet and return the value from a different column in a different cell.
Product cost is the returned value.
Code is the user entry.
The formula in Product cost uses vlookup to search a different sheet with a list of 3500 items for the text in the Code column. then returns the value in the Product cost column.

Some of the returned values are formatted on the basis that the original search text is duplicated.

I want to high light the returned value if the original text is duplicated.
Excel.jpg

Any thoughts?
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
something like this?

Book1
ABCDEF
1CodeCostCodeCost
2Code11Code11
3Code22Code22
4Code33Code33
5Code44Code44
6Code52Code52
7Code66Code66
8Code77Code77
9Code84Code84
Sheet1
Cell Formulas
RangeFormula
B2:B9B2=VLOOKUP(A2,E:F,2,0)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B2:B9Expression=COUNTIF(F:F,B2)>1textNO
 
Upvote 0
something like this?

Book1
ABCDEF
1CodeCostCodeCost
2Code11Code11
3Code22Code22
4Code33Code33
5Code44Code44
6Code52Code52
7Code66Code66
8Code77Code77
9Code84Code84
Sheet1
Cell Formulas
RangeFormula
B2:B9B2=VLOOKUP(A2,E:F,2,0)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B2:B9Expression=COUNTIF(F:F,B2)>1textNO
Kind of,

Its the Code that is duplicated not the cost
Heres the source. column A is the 'CODE'. i want to highlight the price being returned if it the code is duplicated.
Basically Different colours and sizes cost a different amount on some products so want to alert the user to check the price.

Also is there a way to get excel to return the highest price on the vlookup when there is more than 1?.
Excel.jpg
 
Upvote 0
similar, really

Book1
AB
1CodeCost
2Code11
3Code22
4Code33
5Code11
6Code11
7Code66
8Code77
9Code33
Sheet1
Cell Formulas
RangeFormula
B2:B9B2=VLOOKUP(A2,E:F,2,0)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B2:B9Expression=COUNTIF($A$2:$A$9,A2)>1textNO
 
Upvote 0
Solution
try this

Book1
AB
1CodeCost
2Code11
3Code22
4Code33
5Code11
6Code13
7Code25
8Code23
Sheet1
Cell Formulas
RangeFormula
B2:B5B2=VLOOKUP(A2,E:F,2,0)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B2:B8Expression=COUNTIF($A$2:$A$8,A2)>1textNO
A2:A8Expression=MAXIFS($B$2:$B$8,$A$2:$A$8,A2)=B2textNO
 
Upvote 0
Will this return the Highest price from the product cost column?
 
Upvote 0
yes, as you can see the sample data from post #8 above, only the highest cost with same code are high lighted
 
Upvote 0

Forum statistics

Threads
1,214,789
Messages
6,121,605
Members
449,038
Latest member
Arbind kumar

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