+ Reply to Thread
Results 1 to 5 of 5

switching order of numbers

  1. #1
    Registered User
    Join Date
    06-11-2008
    Posts
    2

    switching order of numbers

    Hi all. I need help with some data. I have a series of numbers that are listed vertically:

    1
    2
    3
    4
    5

    I need to select them all and switch their orders like this:

    5
    4
    3
    2
    1

    Can someone tell me how to do this? Thanks very much.

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Select a cell within the range then > Data > Sort > Descending

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    06-11-2008
    Posts
    2
    hello, thank you for the reply. I cannot find "descending". When you say select a cell, you mean just click one cell? dont select the whole range? Additionally I just want you to know i am using excel 2007, if that makes a difference. And i guess the other thing i have to mention is the example of mine was perhaps bad.

    Heres a better example of numbers im dealing with and how they appear:

    5
    1
    6
    8
    2
    9

    So id need them to appear like

    9
    2
    8
    6
    1
    5

    These are stock prices so they are in no numerical order. So i assume even if i could find descending that this would put them in descending numerical value?

    Any help appreciated, sorry if i wasnt clear. thx

  4. #4
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885
    A reasonably simple method would be to use an array formula. For example, if your data was in cells A1:A100, then in B1 use:

    =OFFSET($A$1:$A$100,MAX(ROW($B$1:$B$100))-ROW(),0)

    ** After typing this formula, you must press CONTROL+SHIFT+ENTER since it is an array formula. (By doing so, braces will automatically be added around the formula. Don't add the braces, {}, yourself.)

    After pressing C+S+E, you should now see the value from the last row in column A appear in B1. Fill the formula in B1 down to B100 and you'll now have a reversed list.

  5. #5
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    See link under "Reversing The Order Of A List"


    http://www.cpearson.com/excel/lists.htm

    or

    =INDEX($A$1:$A$6,ROWS($A$1:$A$6)-(ROW()-ROW(B$1)))
    VBA Noob

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1