+ Reply to Thread
Results 1 to 7 of 7

Show lowest missing number in a sequence w/repeating numbers and blanks

  1. #1
    Forum Contributor
    Join Date
    12-17-2008
    Location
    Vernon, CT
    Posts
    132

    Show lowest missing number in a sequence w/repeating numbers and blanks

    I have a program that will be referencing this sheet so I can't have any VBA/macros or sorting involved. I just created a basic example of what I need and attached it. I can rearrange the formulas from there. I am looking for a formula in D2 that will look at column A and tell me the lowest number that is missing.It can reference column B or I don't need that all. The numbers will range from 1 to whatever in sequencial order.

    There is other data that will be in this sheet, but people will be entering the number truck they placed each order (row) into (Column B). So there will be several rows/orders in the same numbered truck. There will be some that aren't in a truck yet. These trucks are transfer trucks from one facility to another and each truck is filled on different days. So for example once truck number 1 is used the next person will see they need to use truck number 2 for their orders and so on. There is a "use next" cell, but if someone uses the wrong number, in this case let's say they put in an 8, I want to say they are missing a 6 in D1.


    Thanks for any help on this. I have tried several different ways, but have been unable to get the desired results.
    Attached Files Attached Files
    Last edited by jayclinton; 03-15-2016 at 02:17 PM.

  2. #2
    Valued Forum Contributor ranman256's Avatar
    Join Date
    07-29-2012
    Location
    Kentucky
    MS-Off Ver
    Excel 2003
    Posts
    1,190

    Re: Show lowest missing number in a sequence w/repeating numbers and blanks

    you will need vb or a macro.

  3. #3
    Valued Forum Contributor
    Join Date
    07-29-2009
    Location
    Belgium
    MS-Off Ver
    Excel 2003/Excel 2010
    Posts
    534

    Re: Show lowest missing number in a sequence w/repeating numbers and blanks

    This formula will give you the lowest missing number (numbers in B2:B100 for example).
    Please Login or Register  to view this content.
    Replace ";" in formula with "," if needed.
    Attached Files Attached Files

  4. #4
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,957

    Re: Show lowest missing number in a sequence w/repeating numbers and blanks

    I notice that some truck numbers are duplicated. I assume this means multiple orders went on that truck so truck 4 carried orders 123, 5151 and 55. The question I have is how do I know that a truck is filled? Right now there are 5 orders on truck number 5. How do I know when to stop using this truck and move onto truck number 6?

    Also how do I know that I can't add another order to truck number 4?

    Anyway, why would VBA invalidate using this sheet? You could put a change event on column B that will provide data validation and figure out the missing number without any manual intervention other than the user entering a number.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  5. #5
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,957

    Re: Show lowest missing number in a sequence w/repeating numbers and blanks

    If all you want is the missing number, try this formula: =IF(MAX(B2:B32)>LARGE(B2:B32,2)+1,LARGE(B2:B32,2)+1,"").

    What this formula does is find the second largest number using LARGE (in this case also 5) and if the number being added (found by MAX) is more than one more than it, it suggests one more than it. So it is blank if you are adding any number up to the next number allowed.

  6. #6
    Forum Contributor
    Join Date
    12-17-2008
    Location
    Vernon, CT
    Posts
    132

    Re: Show lowest missing number in a sequence w/repeating numbers and blanks

    Awesome! Thanks dflak. That worked perfectly! WHER- I tried that, but all I could get was a #name error when I changed any data. dflak's works perfectly. Thanks everyone. I appreciate it.

  7. #7
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    18,944

    Re: Show lowest missing number in a sequence w/repeating numbers and blanks

    WHER's solution worked fine using ver. 2010, the WORKDAY.INTL function was added as of the 2003 version. As a test change, for example, the values of B4:B5 in his attached file to 7 and it will find that the number 3 truck has not been used.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Insert missing rows into repeating number sequence
    By budgie300 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-12-2012, 06:17 PM
  2. [SOLVED] How do I find a missing number in a sequence of numbers?
    By Peo Sjoblom in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 09-06-2005, 07:05 PM
  3. [SOLVED] How do I find a missing number in a sequence of numbers?
    By Peo Sjoblom in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-06-2005, 07:05 AM
  4. [SOLVED] How do I find a missing number in a sequence of numbers?
    By Peo Sjoblom in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-06-2005, 06:05 AM
  5. [SOLVED] How do I find a missing number in a sequence of numbers?
    By Nash in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  6. [SOLVED] How do I find a missing number in a sequence of numbers?
    By Nash in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  7. How do I find a missing number in a sequence of numbers?
    By Nash in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM
  8. [SOLVED] How do I find a missing number in a sequence of numbers?
    By Nash in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 PM

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