listing a column in reverse order

A

Archimedes

Column A contains a finite list of numbers, not necessarily sorted by order
of magnitude. I want Column B to contain the same list of numbers, but
listed in precisely the reverse order. How do I do this?
 
G

Gary''s Student

copy column A to column B
in column C, enter:
1
2
3
4
5
6
....

down as far as column B

Then sort columns B & C by C descending
 
G

Gary''s Student

Using VBA:

Sub invertum()
n = Cells(Rows.Count, "A").End(xlUp).Row
k = n
For i = 1 To n
Cells(i, "B").Value = Cells(k, "A").Value
k = k - 1
Next
End Sub
 
G

Gord Dibben

Assume your list in column A is A1:A100

Enter this in B1 =INDEX($A$1:$A$100,100-(ROW(A1)-1))

Double-click on fill handle of B1


Gord Dibben MS Excel MVP
 
J

JMB

it's the same thing, but if you didn't want to hardcode the 100:
=INDEX(A$1:A$100,ROWS(A1:A$100))
 

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