Comparing duplicate values, finding MIN, conditional formatting

shiftdelete

New Member
Joined
Dec 10, 2014
Messages
9
I've tried a few methods, but I'm struggling to put them all together to get my exact scenario to work. Any help is greatly appreciated.

I have a spreadsheet that needs to search down column B (Rate), find any duplicate values (there will be 12-15 duplicate pairs)-- and compare the values of Column C (Price) between the duplicate pairs and get the smallest value. (I'm using this to do conditional formatting - changing font color so that it looks greyed out.)

See the example below-- I would like to apply the formatting to columns A, B & C to dim the font color. (or at LEAST column C.) I cannot have the entire row highlighted, because I have additional non-related data in other columns.

[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]Coupon[/TD]
[TD]Rate[/TD]
[TD]Price[/TD]
[/TR]
[TR]
[TD]2.5[/TD]
[TD]3.25[/TD]
[TD]98.335[/TD]
[/TR]
[TR]
[TD]2.5[/TD]
[TD]3.375[/TD]
[TD]99.032[/TD]
[/TR]
[TR]
[TD]2.5[/TD]
[TD]3.50[/TD]
[TD]99.600[/TD]
[/TR]
[TR]
[TD]3.0
[/TD]
[TD]3.25
[/TD]
[TD]97.101
[/TD]
[/TR]
[TR]
[TD]3.0
[/TD]
[TD]3.375
[/TD]
[TD]98.289
[/TD]
[/TR]
[TR]
[TD]3.0
[/TD]
[TD]3.50
[/TD]
[TD]99.413
[/TD]
[/TR]
[TR]
[TD]3.0[/TD]
[TD]3.625[/TD]
[TD]100.472[/TD]
[/TR]
[TR]
[TD]3.0[/TD]
[TD]3.75[/TD]
[TD]101.328[/TD]
[/TR]
[TR]
[TD]3.0[/TD]
[TD]3.875[/TD]
[TD]101.923[/TD]
[/TR]
[TR]
[TD]3.0[/TD]
[TD]4.00[/TD]
[TD]102.404[/TD]
[/TR]
[TR]
[TD]3.5
[/TD]
[TD]3.75
[/TD]
[TD]100.214
[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
you can use this conditional formatting rule


=IF(COUNTIF($B$2:$B$12,$B2)>1,MIN(IF($B2=$B$2:$B$12,$C$2:$C$12))=$C2,FALSE)



Excel 2013
ABC
1CouponRatePrice
22.53.2598.335
32.53.37599.032
42.53.599.6
533.2597.101
633.37598.289
733.599.413
833.625100.472
933.75101.328
1033.875101.923
1134102.404
123.53.75100.214
Sheet1
 
Last edited:
Upvote 0
Thanks VBA Geek!!

I have 1 follow-up question that is based on the same data.

I have a separate excel workbook that I am linking to this one. Column A is rate. Column B is price.

How can I pull the list of Rates & Prices, removing the MIN of any duplicates?
 
Last edited:
Upvote 0
hi, no problem.

could you post again the the tables and the desired results? you can put both tables on the same sheet for convenience
 
Upvote 0
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]Book1, Sheet1[/TD]
[TD][/TD]
[TD][/TD]
[TD]Book2, Sheet1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A (Rate)[/TD]
[TD]B (Price)[/TD]
[TD][/TD]
[TD]A (Rate)[/TD]
[TD]B (Price)[/TD]
[/TR]
[TR]
[TD]3.25[/TD]
[TD]98.335[/TD]
[TD][/TD]
[TD]4.00[/TD]
[TD]102.404[/TD]
[/TR]
[TR]
[TD]3.375[/TD]
[TD]99.032[/TD]
[TD][/TD]
[TD]3.875[/TD]
[TD]101.923[/TD]
[/TR]
[TR]
[TD]3.5[/TD]
[TD]99.600[/TD]
[TD][/TD]
[TD]3.75[/TD]
[TD]101.328[/TD]
[/TR]
[TR]
[TD]3.25
[/TD]
[TD]97.101
[/TD]
[TD][/TD]
[TD]3.625[/TD]
[TD]100.472[/TD]
[/TR]
[TR]
[TD]3.375
[/TD]
[TD]98.289
[/TD]
[TD][/TD]
[TD]3.50[/TD]
[TD]99.600[/TD]
[/TR]
[TR]
[TD]3.5
[/TD]
[TD]99.413
[/TD]
[TD][/TD]
[TD]3.375[/TD]
[TD]99.032[/TD]
[/TR]
[TR]
[TD]3.625[/TD]
[TD]100.472[/TD]
[TD][/TD]
[TD]3.25[/TD]
[TD]98.335[/TD]
[/TR]
[TR]
[TD]3.75[/TD]
[TD]101.328[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3.875[/TD]
[TD]101.923[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4.00[/TD]
[TD]102.404[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3.75
[/TD]
[TD]100.214
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Book2,Sheet1 will externally reference Book1,Sheet1 and display a list in descending order of all Rates, taking the Max Price for any duplicate Rate Values. Does that make sense? I could have this list made on a new sheet in Book1 if it is too hard to create the formula using an external reference.
 
Upvote 0
You'd do it like this


<b>Array Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: #FFFFFF;border-collapse: collapse; border-color: #BBB"><thead><tr style=" background-color: #DAE7F5;color: #161120"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: #DAE7F5;color: #161120">D2</th><td style="text-align:left">{=LARGE(<font color="Blue">A$2:A$12,SUM(<font color="Red">1,COUNTIF(<font color="Green">A$2:A$12,D$1:D1</font>)</font>)</font>)}</td></tr></tbody></table><b>Entered with Ctrl+Shift+Enter.</b> If entered correctly, Excel will surround with curly braces {}.</td></tr></table><br />

<b>Array Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: #FFFFFF;border-collapse: collapse; border-color: #BBB"><thead><tr style=" background-color: #DAE7F5;color: #161120"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: #DAE7F5;color: #161120">E2</th><td style="text-align:left">{=MAX(<font color="Blue">IF(<font color="Red">$D2=A$2:A$12,B$2:B$12</font>)</font>)}</td></tr></tbody></table><b>Entered with Ctrl+Shift+Enter.</b> If entered correctly, Excel will surround with curly braces {}.</td></tr></table><br />




Excel 2013
ABCDE
1RATEPRICERATEPRICE
23.2598.3354102.404
33.37599.0323.875101.923
43.599.63.75101.328
53.2597.1013.625100.472
63.37598.2893.599.6
73.599.4133.37599.032
83.625100.4723.2598.335
93.75101.328
103.875101.923
114102.404
123.75100.214
ACCESS
 
Upvote 0

Forum statistics

Threads
1,223,098
Messages
6,170,100
Members
452,301
Latest member
QualityAssurance

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