Two values highlight

dineshchaure26

New Member
Joined
May 16, 2012
Messages
3
In column A, suppose I have the below values

100.456
100.789
101.000
101.245
101.675

Now I want to use a formula that will highlight the immediate highest and lowest values from the column for a given number.

For example if the number that needs to searched is 100.987, then 100.789 and 101.000 must highlight since 100.987 falls between these two numbers in the column.

Please help me with the formula that I can use in conditional formatting.
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Book1
AB
1Search number
2100.456100.987
3100.789
4101
5101.245
6101.675
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:A6Expression=A2=AGGREGATE(15,6,$A$2:$A$6/($A$2:$A$6>$B$2),1)textNO
A2:A6Expression=A2=AGGREGATE(14,6,$A$2:$A$6/($A$2:$A$6<$B$2),1)textNO
 
Upvote 0
Book1
AB
1Search number
2100.456100.987
3100.789
4101
5101.245
6101.675
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:A6Expression=A2=AGGREGATE(15,6,$A$2:$A$6/($A$2:$A$6>$B$2),1)textNO
A2:A6Expression=A2=AGGREGATE(14,6,$A$2:$A$6/($A$2:$A$6<$B$2),1)textNO
Thank you much :)
 
Upvote 0
I suggest that you update your Account details (click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

You could highlight them both with one CF rule.

21 12 16.xlsm
AB
1Search number
2100.456100.987
3100.789
4101.000
5101.245
6101.675
Above Below
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:A6Expression=OR(B$2=MEDIAN(B$2,A2,A3),B$2=MEDIAN(B$2,A1,A2))textNO
 
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