+ Reply to Thread
Results 1 to 7 of 7

smallest missing number

  1. #1
    Chris_t_2k5
    Guest

    smallest missing number

    Here is my problem,

    I have numbers in cells F1:K1 eg, 1,2,3,5,6,7.

    Is it possible to have in cell L1 a function / formula to display the
    smallest missing number (ie. 4 in the example). The missing number can be
    anything upto 15.

    Thanks

  2. #2
    Registered User
    Join Date
    01-05-2006
    Posts
    65
    Will the number always be in ascending order from left to right?

  3. #3
    Registered User
    Join Date
    01-05-2006
    Posts
    65
    If they will always be in ascending order and always only 6 numbers then the
    following formula will work:

    =IF(G1-F1>1,F1+1,IF(H1-G1>1,G1+1,IF(I1-H1>1,H1+1,IF(J1-I1>1,I1+1,IF(K1-J1>1,J1+1,K1+1)))))

    Its not very elegant but it gets the job done. Perhaps someone else will come
    along with a simpler formula.

  4. #4
    Bob Phillips
    Guest

    Re: smallest missing number

    Try this

    =SMALL(IF(ISERROR(MATCH(ROW(INDIRECT("1:15")),F1:K1,0)),ROW(INDIRECT("1:15")
    )),1)

    which is an array formula, it should be committed with Ctrl-Shift-Enter, not
    just Enter.

    --
    HTH

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "Chris_t_2k5" <[email protected]> wrote in message
    news:[email protected]...
    > Here is my problem,
    >
    > I have numbers in cells F1:K1 eg, 1,2,3,5,6,7.
    >
    > Is it possible to have in cell L1 a function / formula to display the
    > smallest missing number (ie. 4 in the example). The missing number can be
    > anything upto 15.
    >
    > Thanks




  5. #5
    CLR
    Guest

    RE: smallest missing number

    Here's something.........it doesn't deal well with zero or decimals, but
    seems to work with whole numbers pretty good...........

    =IF(SMALL(F1:K1,2)>SMALL(F1:K1,1)+1,SMALL(F1:K1,1)+1,IF(SMALL(F1:K1,3)>SMALL(F1:K1,2)+1,SMALL(F1:K1,2)+1,IF(SMALL(F1:K1,4)>SMALL(F1:K1,3)+1,SMALL(F1:K1,3)+1,IF(SMALL(F1:K1,5)>SMALL(F1:K1,4)+1,SMALL(F1:K1,4)+1,IF(SMALL(F1:K1,6)>SMALL(F1:K1,5)+1,SMALL(F1:K1,5)+1,"yuk")))))

    Remember, the formula goes all on one line, watch out for email word-wrap.

    Vaya con Dios,
    Chuck, CABGx3



    "Chris_t_2k5" wrote:

    > Here is my problem,
    >
    > I have numbers in cells F1:K1 eg, 1,2,3,5,6,7.
    >
    > Is it possible to have in cell L1 a function / formula to display the
    > smallest missing number (ie. 4 in the example). The missing number can be
    > anything upto 15.
    >
    > Thanks


  6. #6
    Chris_t_2k5
    Guest

    Re: smallest missing number

    Thanks worked just how i wanted it to!

    "Bob Phillips" wrote:

    > Try this
    >
    > =SMALL(IF(ISERROR(MATCH(ROW(INDIRECT("1:15")),F1:K1,0)),ROW(INDIRECT("1:15")
    > )),1)
    >
    > which is an array formula, it should be committed with Ctrl-Shift-Enter, not
    > just Enter.
    >
    > --
    > HTH
    >
    > Bob Phillips
    >
    > (remove nothere from email address if mailing direct)
    >
    > "Chris_t_2k5" <[email protected]> wrote in message
    > news:[email protected]...
    > > Here is my problem,
    > >
    > > I have numbers in cells F1:K1 eg, 1,2,3,5,6,7.
    > >
    > > Is it possible to have in cell L1 a function / formula to display the
    > > smallest missing number (ie. 4 in the example). The missing number can be
    > > anything upto 15.
    > >
    > > Thanks

    >
    >
    >


  7. #7
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451
    Sounds like you're playing pool.

+ 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