+ Reply to Thread
Results 1 to 9 of 9

Display missing sequencial numbers

Hybrid View

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

    Question Display missing sequencial numbers

    I have a sheet where one column has sequencial numbers from lowest to highest with some missing. So for example: A1 1, A2 3, A3 5, A4 6. Is there a formula that will display all the numbers that are missing from this column without skipping rows? So let's say: B1 2, B2 4 ect.

    Basically I will be putting this on a different tab, so someone can go to that tab and see what numbers have not been used. It is a large range and is difficult for someone to scan through it all.

    Thanks for any assistance.
    Last edited by jayclinton; 04-22-2013 at 07:28 PM.

  2. #2
    Forum Contributor
    Join Date
    08-22-2011
    Location
    Texas, United States
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    516

    Re: Display missing sequencial numbers

    You could do this with VBA easily but i am not sure it can just be done in a worksheet function
    Regards,
    amotto

    If I helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  3. #3
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Display missing sequencial numbers

    I agree with amotto11. This would be much easier with VBA.

    Attached is as near as I can get so far.
    Enter the numbers in column A.
    Enter the expected sequence in column C (Just enter the starting number of the sequence then drag the corner to fill the series)
    Column D returns the missing numbers (however it does skip rows).
    Attached Files Attached Files
    *******************************************************

    HELP WANTED! (Links to Forum threads)
    Trying to create reusable code for Custom Events at Workbook (not Application) level

    *******************************************************

  4. #4
    Registered User
    Join Date
    05-13-2010
    Location
    Kozhikode, Keral, India
    MS-Off Ver
    Microsoft Office home and student 2019
    Posts
    49

    Re: Display missing sequencial numbers

    true VBA is the best and easy option for this
    Best Regards
    Chandrajit

  5. #5
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,675

    Re: Display missing sequencial numbers

    Try with formula:
    Assuming list from A2:A37
    In B2:
    =IF(COUNT($B$1:B1)+COUNT($A$1:$A$37)>=MAX($A$2:$A$37),"",SMALL(IF(FREQUENCY($A$2:$A$37,ROW($A$1:INDIRECT("A"&MAX($A:$A))))=0,ROW($A$1:INDIRECT("A"&MAX($A:$A)+1)),""),ROW(1:1)))
    Confirmed with Ctrl-Shift- Enter
    Drag down
    Attached Files Attached Files
    Quang PT

  6. #6
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Display missing sequencial numbers

    Quote Originally Posted by bebo021999 View Post
    Try with formula
    Wow. I didn't think this could be solved by using formulas only. Very impressive +1.

  7. #7
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,675

    Re: Display missing sequencial numbers

    Quote Originally Posted by mc84excel View Post
    Wow. I didn't think this could be solved by using formulas only. Very impressive +1.
    Yep. Except if data size is too large.

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

    Re: Display missing sequencial numbers

    Perfect! Thanks this is just what I needed. Thanks for everyones help.

    Quote Originally Posted by bebo021999 View Post
    Try with formula:
    Assuming list from A2:A37
    In B2:
    =IF(COUNT($B$1:B1)+COUNT($A$1:$A$37)>=MAX($A$2:$A$37),"",SMALL(IF(FREQUENCY($A$2:$A$37,ROW($A$1:INDIRECT("A"&MAX($A:$A))))=0,ROW($A$1:INDIRECT("A"&MAX($A:$A)+1)),""),ROW(1:1)))
    Confirmed with Ctrl-Shift- Enter

    Drag down

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

    Re: Display missing sequencial numbers

    What version of Excel are you using?

    Try this and we'll tweak it once we know what version of Excel you're using.

    Let's assume the sequence of numbers is 1 to 6.

    Enter this array formula** in B1:

    =SMALL(IF(ISNA(MATCH(ROW(INDIRECT("1:6")),A$1:A$4,0)),ROW(INDIRECT("1:6"))),ROWS(B$1:B1))

    ** 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 start getting errors. We can remove the errors but need to know what version of Excel you're using so we can use the best method.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ 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