Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

reversing a list in Excel

Posted on 2013-11-21
7
Medium Priority
?
248 Views
Last Modified: 2013-11-21
I know how to sort ascending / descending

I have have a list that I need to invert, but keep the integrity of the list

5
6
10
11
9
4
3

to

3
4
9
10
11
6
5


How do I do this in MS Excel ?  (my list is very long)
0
Comment
Question by:Europa MacDonald
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 33

Accepted Solution

by:
Rob Henson earned 2000 total points
ID: 39666421
In the next column over, add an identifier starting at 1 and incrementing by 1 as going down the column.

Then highlight both columns (and other columns if related) and sort on the new ID column but using Large to Small.

Thanks
Rob H
0
 

Author Comment

by:Europa MacDonald
ID: 39666438
sort on new ID column ?
0
 
LVL 33

Expert Comment

by:Rob Henson
ID: 39666448
Column that you have just created by adding an identifier from 1 to x
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Europa MacDonald
ID: 39666461
whats an identifier ?
0
 
LVL 33

Expert Comment

by:Rob Henson
ID: 39666485
Identifier = anything that enables identification. In this instance a number that indicates position.

See attached. Top section formulas, bottom section copy pasted values.  I have done this as a separate list but I guess you would do the copy paste in place and sort the original list.

Thanks
Rob H
List-Integrity.xlsx
0
 

Author Closing Comment

by:Europa MacDonald
ID: 39666551
great thanks
0
 
LVL 49

Expert Comment

by:Martin Liss
ID: 39666616
Here's a macro. It assumes the data is in column A.
Sub ReverseList()

Dim DataRange As Variant ' Must be Variant
Dim Reversed() As String
Dim lngRow As Long
' This loads DateRange with the sheet's values. Note the use of ".Value"
With ActiveSheet
    DataRange = .Range("A1:A" & .UsedRange.Rows.Count).value ' read all the values at once from the Excel grid, put into an array
    ReDim Reversed(.UsedRange.Rows.Count - 1)
    ' Saved the values in revewrse order
    For lngRow = 1 To UBound(DataRange)
        Reversed(UBound(DataRange) - lngRow) = DataRange(lngRow, 1)
    Next
    ' Replace the values
    For lngRow = 0 To UBound(Reversed)
        DataRange(lngRow + 1, 1) = Reversed(lngRow)
    Next
    ' Update the sheet
    .Range("A1:A" & .UsedRange.Rows.Count).value = DataRange ' writes all the results back to the range at once
End Wit

Open in new window

h
0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was prompted to write this article after the recent World-Wide Ransomware outbreak. For years now, System Administrators around the world have used the excuse of "Waiting a Bit" before applying Security Patch Updates. This type of reasoning to me …
Outlook for dependable use in a very small business   This article is about using the Outlook application (part of Microsoft Office) in a very small business, or for homeowners where dependability and reliability are critical requirements. This …
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question