excell sorting question

  • Thread starter Thread starter twosix
  • Start date Start date
T

twosix

does anyone know how to do a sort for how close a list of numbers com
to a designated cell with a index number in that cell??

example:

a 39
b 40
c 51
d 44
e 43

sort by being the same or the closest to "44"

results should be:

d 44
e 43
b 40
a 39
c 5
 
Twosix,

You can add a helper column...

In the column next to that one (assume A1:A5) enter
=ABS(44-A1) and drag down to fill the series.

Select both columns and choose Data -> Sort and sort
according to the helper column.

Dan E
 
You might do this by using a helper column:
and sorting on it. I would use the following which
provides for handling both positive and negative numbers
=ABS(44-ABS(A1))
 
Thanks to you all !!!! your solution worked perfectly
=abs(44-a1) converted the negative numbers to positive numbers. this
allowed me to sort (assending) and determine which numbers were the
same and/or closest to the number being compared to.

thank you for your quick response

twosix
 
Thanks for posting which reply you went with. It also made me
look again at my answer to see that mine was incorrect .
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top