+ Reply to Thread
Results 1 to 5 of 5

reverse order of data in one cell

  1. #1
    Registered User
    Join Date
    08-23-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    2

    reverse order of data in one cell

    Hi, I'm new to the forum and really hoping a kind soul out there can help me with a problem that is starting to make me pull my hair out!

    I have multiple cells which each contain a series of numbers (although not the same amount of numbers in each one) seperated by line breaks (Alt + enter)

    cell A1 looks like

    2,221,428
    124,596
    81,715
    73,616
    1,157,968
    1,257,935
    300,953

    For each cell I need to reverse the order so that the last number comes first, ie

    300,953
    1,257,935
    1,157,968
    73,616
    81,715
    124,596
    2,221,428

    There are a large number of cells like this so I'm hoping there is some sort of solution out there....

  2. #2
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: reverse order of data in one cell

    You can add this code to a module in your workbook:

    Please Login or Register  to view this content.
    To give you a new function, ReverseList

    So if your data was in A1 you could use the formula:

    =ReverseList(A1,CHAR(10))

    Or add a sub to do a batch of cells in one go:

    Please Login or Register  to view this content.

  3. #3
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: reverse order of data in one cell

    lostinexcel77,

    Welcome to the forum!
    Unfortunately, Excel's native CONCATENATE() function doens't work with arrays. This means that there is no way Excel can perform what you're asking for without the use of VBA (like Andrew has provided) or an add-in.

    Here is an alternate solution using the Morefunc add-in which provides the MCONCAT function:
    Please Login or Register  to view this content.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: reverse order of data in one cell

    I came to the same conclusion as Tigeravatar... but used a UDF instead of Morefunc (which I am not sure works well with 2007 or 2010 versions)..

    so UDF:

    Please Login or Register  to view this content.
    and formula similar to Tigeravatar:

    Please Login or Register  to view this content.
    confirmed with CTRL+SHIFT+ENTER
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  5. #5
    Registered User
    Join Date
    08-23-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: reverse order of data in one cell

    Thanks so much to you all. fantastic!!!

    these are all doing the trick.

    many, many thanks

+ 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