+ Reply to Thread
Results 1 to 9 of 9

Automatic Sort using a formula

Hybrid View

pauldaddyadams Automatic Sort using a formula 05-18-2012, 07:33 AM
micope21 Re: Automatic Sort using a... 05-18-2012, 07:44 AM
pauldaddyadams Re: Automatic Sort using a... 05-18-2012, 08:09 AM
micope21 Re: Automatic Sort using a... 05-18-2012, 08:26 AM
Pete_UK Re: Automatic Sort using a... 05-18-2012, 08:30 AM
micope21 Re: Automatic Sort using a... 05-18-2012, 08:35 AM
pauldaddyadams Re: Automatic Sort using a... 05-18-2012, 09:39 AM
micope21 Re: Automatic Sort using a... 05-18-2012, 01:37 PM
pauldaddyadams Re: Automatic Sort using a... 05-18-2012, 09:11 AM
  1. #1
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,702

    Automatic Sort using a formula

    Hi All

    Need some help please...

    I have two columns which I need to be able to sort automatically without selecting the data, copy and pasting it and then sorting it manually. Can this be done with a formula?

    The customer names are in column D and the ranking field is in column E on my "Summary" sheet. Can it be set up so that the last row is found e.g.
    =INDEX(Summary!$D:$D,ROW(Summary!$D$4)+1):INDEX(Summary!$D:$D,Last_Row)
    I have attached an example file - I would need the formulas to be placed in the yellow coloured fields.
    Attached Files Attached Files
    Last edited by pauldaddyadams; 05-18-2012 at 07:41 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    03-20-2011
    Location
    UK
    MS-Off Ver
    Excel 2007/10/16
    Posts
    840

    Re: Automatic Sort using a formula

    Hi

    Cell Y4 =LARGE($E$4:$E$23,ROWS($1:1)) Then copy down

    Cell X4 =INDEX($D$4:$D$23,SMALL(IF($E$4:$E$23=Y4,ROW($E$4:$E$23)-MIN(ROW($E$4:$E$23))+1),COUNTIF($Y$4:Y4,Y4))) Control+Shift+Enter.Not Enter. Then copy down.
    To help you by my post? it would be nice to click on to say "Thank you".
    If you are happy with a solution to your problem?
    Click Thread Tools above your first post,
    select "Mark your thread as Solved".

  3. #3
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,702

    Re: Automatic Sort using a formula

    Hi,

    This worked brilliantly thank you!!

    I know I am changing the goal posts but is there any way in which now I have this list I can display the top 5 and bottom 5 results? I have updated the example file for what I am trying to achieve.

    I would need it displayed like it is in the example file as i plan to plot the data in a graph
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor
    Join Date
    03-20-2011
    Location
    UK
    MS-Off Ver
    Excel 2007/10/16
    Posts
    840

    Re: Automatic Sort using a formula

    Top 5
    Cell AD4 =LARGE($E$4:$E$23,ROWS($1:1)) Then copy down

    Cell AC4 =INDEX($D$4:$D$23,SMALL(IF($E$4:$E$23=Y4,ROW($E$4:$E$23)-MIN(ROW($E$4:$E$23))+1),COUNTIF($Y$4:Y4,Y4))) Control+Shift+Enter.Not Enter. Then copy down.

    Bottom 5
    This not easy with bottom 5.
    Get bottom without 0

    Cell AD18
    =MIN(IF(($Y:Y>0),$Y:Y)) Control+Shift+Enter.Not Enter.

    It long time I did bottom 3 got file in my computer some where.

    Get back to you for this one.

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,423

    Re: Automatic Sort using a formula

    The attached shows how you can do it.

    Hope this helps.

    Pete
    Attached Files Attached Files

  6. #6
    Valued Forum Contributor
    Join Date
    03-20-2011
    Location
    UK
    MS-Off Ver
    Excel 2007/10/16
    Posts
    840

    Re: Automatic Sort using a formula

    Find the file.

    I look at Peter_UK

    It same the formula as Peter_UK for bottom 5 =INDEX(Y$4:Y$23,COUNTIF(Y$4:Y$23,"<>0")-5+ROWS(A$1:A1))
    Last edited by micope21; 05-18-2012 at 08:44 AM.

  7. #7
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,702

    Re: Automatic Sort using a formula

    is there any way this formula:
    =LARGE($G$4:$G$204,ROWS($1:1))
    can be changed to ignore zero values e.g.
    my data has the following list
    300
    200
    100
    0
    0
    0
    -100
    -200
    -300

    I would like this to appear as:
    300
    200
    100
    -100
    -200
    -300

    Is that possible?

  8. #8
    Valued Forum Contributor
    Join Date
    03-20-2011
    Location
    UK
    MS-Off Ver
    Excel 2007/10/16
    Posts
    840

    Re: Automatic Sort using a formula

    Please click on attachment
    Attached Files Attached Files

  9. #9
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,702

    Re: Automatic Sort using a formula

    Thanks guys - I will feed this into my model back now and report back if solved!

+ 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