+ Reply to Thread
Results 1 to 5 of 5

Sort Data without using code

Hybrid View

Newbie - again! Sort Data without using code 12-12-2009, 05:12 PM
JBeaucaire Re: Sort Data without using... 12-12-2009, 06:35 PM
Newbie - again! Re: Sort Data without using... 12-12-2009, 07:10 PM
JBeaucaire Re: Sort Data without using... 12-12-2009, 07:44 PM
Newbie - again! Re: Sort Data without using... 12-12-2009, 10:25 PM
  1. #1
    Registered User
    Join Date
    12-12-2009
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2007
    Posts
    3

    Sort Data without using code

    Can a sorted array be produced from a table without using code? The attached sample gives a better idea of what I'm trying to do.

    Thanks
    Attached Files Attached Files
    Last edited by Newbie - again!; 12-12-2009 at 07:34 PM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Sort Data without using code

    Like so...change the categories to a numerical index, then grab the "first" values of each number into the "Desired Outcome" chart.

    E5: =IF(AND($B5=$E$3,$C5=E$4),N(E4)+1,N(E4))
    ...copied down and over onoe column.

    G5: =IF(AND($B5=$G$3,$C5=G$4),N(G4)+1,N(G4))
    ...copied down and over onoe column.

    J5: =IF(MAX(E:E)<ROWS($1:1), "", INDEX($A:$A, MATCH(ROWS($1:1), E:E, 0)))
    ...copied across and down the whole chart.
    Attached Files Attached Files
    Last edited by JBeaucaire; 12-12-2009 at 06:40 PM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    12-12-2009
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Sort Data without using code

    Brilliant. Skip the title 'Rocket Scientist" and go for "Steely-eyed Missle Man" (refer to Apollo13 for further explanation).

    How does the 'n' function work?

    And thanks.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Sort Data without using code

    You can't add 1 to a text value. I want to use a single formula for the whole column and add 1 to the index from the value above if the row matches the criteria, but this won't work in the first row because the values above the first row are text strings ("tackle" and "block").

    In this usage, n(E4) means "give me the numeric value of E4"...which is 0. By using this format, I can write the formula in E5 and just copy down.

  5. #5
    Registered User
    Join Date
    12-12-2009
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Sort Data without using code

    Thanks for that - it all makes sense now.


    As a matter of interest, is there a formula which would sort the output data A-Z if the source data was not in alphabetical order?

+ 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