Sorting Odd & Even Numbers In Excel

A

Alan_NewsGroup

I was wondering if there was a way to sort odd & even numbers in Excel.
We have large spreadsheets of local street addresses that we would like
excel to sort all the even addresses & lump them all together & sort all
the odd street addresses & lump them all together. Is there a little
Macro that will do this for us. Any help would be greatly appreciated.

Thank You...Alan
 
K

Ken Wright

Assuming your house numbers are in a column by themselves in say Col B, and that you have a spare
column A (Just insert a column if not, or use a blank one to the right of the data).

With your first record in B2, in cell A2 put =ISODD(A2) and copy down, and you will now have a
series of TRUE / FALSE statements in Col A. Now just select ALL the data columns, and sort on Col
A, which will list all even number addresses first and then ODD. Then just delete it when you are
done.
 
P

Patrick Molloy

why not add a column and use MOD 2 to get 0's for even
and 1 for odd numbers. Then sort bu this column.

Patrick Molloy
Microsoft Excel MVP
 

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

Top