ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   listing a column in reverse order (https://www.excelbanter.com/excel-programming/402277-listing-column-reverse-order.html)

archimedes

listing a column in reverse order
 
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?

Gary''s Student

listing a column in reverse order
 
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
--
Gary''s Student - gsnu200760


"Archimedes" wrote:

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?


Gary''s Student

listing a column in reverse order
 
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

--
Gary''s Student - gsnu200760


"Archimedes" wrote:

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?


Gord Dibben

listing a column in reverse order
 
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


On Wed, 5 Dec 2007 11:08:01 -0800, Archimedes
wrote:

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?



JMB

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


"Gord Dibben" wrote:

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


On Wed, 5 Dec 2007 11:08:01 -0800, Archimedes
wrote:

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?





All times are GMT +1. The time now is 07:47 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com