+ Reply to Thread
Results 1 to 7 of 7

Formula problem, get and sort numbers between two values

  1. #1
    Registered User
    Join Date
    05-03-2013
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2010
    Posts
    3

    Formula problem, get and sort numbers between two values

    Hi!
    I have been trying and searching all day for a answer but i can't get it to work.
    I got a list of uniqe values like this:

    10003
    10001
    10002
    20001
    20003
    20002
    30002
    30001
    30003

    I start the values with different numbers to be able to split them up in differente classes
    and I need get one of the classes and sort them in descending order.

    I've been trying and almost got it to work with this code.
    Please Login or Register  to view this content.
    But I would need something like this so I can get a single class and sort it.
    Please Login or Register  to view this content.
    I would be really happy for some help here.
    Thanks in advance!
    Last edited by Michaelice; 05-03-2013 at 05:17 PM.

  2. #2
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,889

    Re: Formula problem, get and sort numbers between two values

    Like this you mean?

    Note that these are array formulas. Has to be entered with Ctrl+Shift+Enter.
    Attached Files Attached Files
    <----- If you were helped by my posts you can say "Thank you" by clicking the star symbol down to the left

    If the problem is solved, finish of the thread by clicking SOLVED under Thread Tools
    I don't wish to leave you with no answer, yet I sometimes miss posts. If you feel I forgot you, remind me with a PM or just bump the thread.

  3. #3
    Registered User
    Join Date
    05-03-2013
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Formula problem, get and sort numbers between two values

    Yes, exactly like that!
    Thanks so much for the solution and so fast answer!

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Formula problem, get and sort numbers between two values

    Try this...

    Data in the range A2:A10

    Use cells to hold the boundaries:

    C2 = 20000
    D2 = 30000

    Then, this array formula** entered in E2:

    =IFERROR(SMALL(IF(A$2:A$10>C$2,IF(A$2:A$10<D$2,A$2:A$10)),ROWS(E$2:E2)),"")

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    Copy down until you get blanks.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Registered User
    Join Date
    05-03-2013
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Formula problem, get and sort numbers between two values

    Thanks!
    Both solutions worked perfect for me!

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Formula problem, get and sort numbers between two values

    You're welcome. We appreciate the feedback!

  7. #7
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,889

    Re: Formula problem, get and sort numbers between two values

    Glad to hear it worked!
    If there is a limited number of data and ranges then Autofilter and copy paste will do the same jobb for you without the hassle of array formulas.
    Attached Images Attached Images

+ 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