How to use excel formula to highlight 3 closest values from range -
                 1)  0.218967921
 2)  0.02111355
 3)  0.145493415
 4)  0.151092791
 5)  0.15407891
 6)  0.178046392
 7)  0.11408411  
i need highlight number 0.145493415 ,0.151092791,0.15407891 (column 3,4,5) closest in list.
assuming have unsorted data in a1:a7 without duplicates, , "3 closest values" difference between smallest , largest (of three) smallest difference of any 3 values in range, can use formula in conditional formatting
=abs(rank(a1,a$1:a$7)-match(min(large(a$1:a$7,row(indirect("1:"&count(a$1:a$7)-2)))-large(a$1:a$7,row(indirect("1:"&count(a$1:a$7)-2))+2)),large(a$1:a$7,row(indirect("1:"&count(a$1:a$7)-2)))-large(a$1:a$7,row(indirect("1:"&count(a$1:a$7)-2))+2),0)-1)<=1
it's rather complex can equally applied sized list of values, containing blanks or text values in range
if there's more 1 set of 3 same "spreadover" formula highlights largest set of values.
see this example
Comments
Post a Comment