+ Reply to Thread
Results 1 to 4 of 4

How to return the first X numbers from a range list?

  1. #1
    Registered User
    Join Date
    04-27-2009
    Location
    Brazil
    MS-Off Ver
    Excel 2003
    Posts
    13

    How to return the first X numbers from a range list?

    HI,
    I attached a quick excel file, where I explian the help I need!!

    I want to know if there is a simple way (no macro need) of select from a list of numbers (already shuffled) the 1st "X" amount numbers, that belongs to a pre-determined range.
    It is easier to see the file, than try to explain.
    Can anyone help me pls!!
    Thanks
    Attached Files Attached Files

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

    Re: How to return the first X numbers from a range list?

    Try:

    =IF(COUNT($D$5:D5)>13,"",IF(AND(B6>=$B$2,B6<=$C$2),B6,""))

    copied down
    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.

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: How to return the first X numbers from a range list?

    If you want the list devoid of blanks (ie consecutive) then given the numbers in B are seemingly unique

    Please Login or Register  to view this content.

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

    Re: How to return the first X numbers from a range list?

    Or you can use C as a helper column just to determine which numbers fall in the range, with formula:

    =IF(AND(B6>=$B$2,B6<=$C$2),MAX($D$5:D5)+1,"") copied down

    then, to get the list of 13 separately and with no blank rows between, use formula

    =INDEX($B$6:$B$165,MATCH(ROWS($A$1:$A1),$D$6:$D$165,0))

    copied down 13 rows.

    and if you are going to want a separate list with no blanks,... you probably would want the numbers sorted.. so an additional formula next to the last one would be:

    =SMALL($F$1:$F$13,ROWS($A$1:$A1))

    copied down (where F1:F13) contains the Index/Match formula above...

    Those columns could be hidden, if desired and only show the final result of 13 sorted numbers...
    Last edited by NBVC; 11-19-2009 at 03:03 PM.

+ 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