+ Reply to Thread
Results 1 to 5 of 5

Sorting in Wrapped Grid

  1. #1
    Registered User
    Join Date
    11-27-2018
    Location
    Philadelphia, PA
    MS-Off Ver
    2013
    Posts
    2

    Sorting in Wrapped Grid

    Hello,

    I am wondering if it's possible to sort values Left-Right AND Top-Bottom so that you wind up with a sorted grid. I have a large spreadsheet where all values need to be simultaneously in view, so we can't keep all values in a row or column, but I have not found a way to sort so that they remain in order in this grid form. I've taken a screen shot of an example of the type of sort function i'd like to preform: Unsorted grid values on the left, sorted on the right.

    Sort(X&Y).jpg

    Thank you for your help!

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Sorting in Wrapped Grid

    Via formula,

    A
    B
    C
    D
    E
    F
    G
    H
    I
    1
    2
    1
    6
    5
    1
    2
    3
    E2: =SMALL($A$2:$C$4, 3 * ROWS($A$2:A2) + COLUMNS($A$2:A2) - 3)
    3
    7
    2
    8
    4
    5
    6
    4
    3
    9
    4
    7
    8
    9


    That might not scale well for a large grid.
    Last edited by shg; 11-27-2018 at 06:50 PM.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    11-27-2018
    Location
    Philadelphia, PA
    MS-Off Ver
    2013
    Posts
    2

    Re: Sorting in Wrapped Grid

    Hey shg,

    That's a nifty solution! I should have mentioned- the values i'm trying to sort are Addresses- they start with numbers but contain letters, so they can't be sorted using the SMALL function, I don't think.
    And even though in my example I showed a sorted grid next to an unsorted one, Ideally I'd like to just sort the existing cells without creating a fraternal twin.

    Is this just not possible with excel?

    Thanks,
    Shane

  4. #4
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Sorting in Wrapped Grid

    This sub will sort a grid.
    Please Login or Register  to view this content.

    Note the two optional arguments Descending and WrapVertical.
    WrapVertical is the diference betweeen
    1 2 3
    4 5 6
    7 8 9
    and
    1 4 7
    2 5 8
    3 6 9
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Sorting in Wrapped Grid

    Select the range to sort before run.
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VBA Grid x Grid SUM problems
    By stedaley in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-27-2015, 10:08 AM
  2. Replies: 1
    Last Post: 10-29-2013, 02:11 AM
  3. Replies: 2
    Last Post: 12-15-2011, 04:14 AM
  4. wrapped text?
    By tregrad in forum Excel General
    Replies: 4
    Last Post: 12-12-2009, 04:23 PM
  5. Limit to Wrapped Text?
    By Llobid in forum Excel General
    Replies: 5
    Last Post: 03-07-2006, 12:10 AM
  6. I need to convert grid.doc to an Excel Grid.
    By suavejohn in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 09-01-2005, 02:05 PM
  7. [SOLVED] grid & grid refrences
    By john redmanshaw in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 02-06-2005, 03:06 PM

Tags for this Thread

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