+ Reply to Thread
Results 1 to 3 of 3

Code to Return Missing Number In Range

  1. #1
    Registered User
    Join Date
    03-16-2009
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    97

    Code to Return Missing Number In Range

    Hi there trying to figure out some code so i can find out the missing number in a range of specific numbers.
    eg. I Have -

    "A2" - 101
    "A3" - 101
    "A4" - 102
    "A5" - 102
    "A6" - 104
    "A7" - 104
    "A8" - 105
    "A9" - 105

    And i want x = 103
    and y to return the 6th row number y = 6

    I dont know maybe step through a loop missing out every second number of the range A2 :A9 but i just cant come up with anything to get the missing number. Cheers
    Last edited by radar_jynx; 03-04-2011 at 11:02 AM.

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Code to Return Missing Number In Range

    This regular formula begins the list of missing numbers in Col_A:
    Please Login or Register  to view this content.

    Copy that formula down as far as you need.

    This shorter ARRAY FORMULA, completed by pressing CTRL+SHIFT+ENTER (instead of just ENTER) also works:
    Please Login or Register  to view this content.


    Does that help?

    Note: the IFERROR function is available in Excel 2007 and later.

    (I'm still working on getting the row reference.)
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Registered User
    Join Date
    03-16-2009
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    97

    Smile Re: Code to Return Missing Number In Range

    I put my mind to it and come up with ->

    Please Login or Register  to view this content.

+ 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