+ Reply to Thread
Results 1 to 11 of 11

Calculating Missing Values in Number Series

  1. #1
    Registered User
    Join Date
    03-08-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    27

    Post Calculating Missing Values in Number Series

    Hi Guys,

    I've got an excel problem which I hope someone here can help me resolve.

    I have a list of ranges :-

    90885 – 90887
    90889 - 90890
    90894 - 90898
    90901 - 90910
    90912 - 90921
    90923 - 90932
    90934 - 90943

    The actual list is somewhat longer, but you get the idea.

    What I need is way of getting excel to work out and display all the numbers that fall between the ranges.

    Lets take the first row as an example. The begining number is 90885, whereas the final number is 90887. Therefore the missing value is 90886.
    If we then take the 5th row (as it a better representation of what I would like) the start number is 90912 and the final number is 90921. So the missing values are 90913, 90914, 90915, 90916, 909017, 90918, 90919 and 90920.

    I'd like advice on a solution that would look at the first row, work out the missing number and put this in the top cell of a different column labelled Result. Then look the next row of data in the example, find the missing values and append them to the Results column in the next cell below where the first result was stored, and so on. Hope I've explained this well enough to understand. An example of the results of the querying the first three rows of data is represented below (the start and final value in each row can be in different cells if that makes it easier):-

    DATA
    90885 – 90887
    90889 - 90890
    90894 - 90898


    RESULTS
    90886
    90895
    90896
    90897


    Any help that any of you expert can offer would be very much appreciated.

    Thank you in anticipation of youR offers of help

    Mike
    Last edited by mike.greene; 03-08-2012 at 09:50 PM. Reason: SOLVED

  2. #2
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Calculating Missing Values in Number Series

    I use formula to phrase out the beginning value and ending value for each row then I wrote a macro to get the list.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    03-08-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: Calculating Missing Values in Number Series

    Thank you so much JieJenn, for taking the time to help me resolve my issue.

    I should have mentioned that I have very little Excel knowledge (but I'm willing to learn).

    Could you explain how I can make use of your good work?

    The values I referred to as 'Data' in my post are currently in column A, with each range in a single cell ie 90885 - 90887 is in A1 the next range in cell A2 etc.

    When I run the macro it puts the word 'Result' in Cell G1, but no numbers are listed under that title.

    Is there something else I shold be doing? Would be grateful if you could clarify.

    Kind regards

    Mike

    PS I also tried the macro with 90885 in cell A1 and 90887 in cell B1 etc, with the same result.

  4. #4
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Calculating Missing Values in Number Series

    Can you attach the file you were using?

  5. #5
    Registered User
    Join Date
    03-08-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: Calculating Missing Values in Number Series

    Please find file attached.
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Calculating Missing Values in Number Series

    You need to parse out the beginning and ending sequence using formula, then you run the macro.
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Calculating Missing Values in Number Series

    just an FYI. The macro looks the raw data starting from row #2 not row1. So you might want to shift the table by one row.

  8. #8
    Registered User
    Join Date
    03-08-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: Calculating Missing Values in Number Series

    If I were to pre-columnise the data into Column A (for the Start values) and Column B (for the Final values), how would the macro have to be altered to accomodate this? I don't want to take up too much of your time, you have already been very helpful.

  9. #9
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Calculating Missing Values in Number Series

    You change cells(i,2) to cells(i,3) to cells(i,1) to cells(i,2) Here is the code

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    03-08-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: Calculating Missing Values in Number Series

    Wow, this is amazing!!

    Thank you so, so much JieJenn

    You have no idea how much manual work you have saved me.

    I am so very grateful to you.

    with kindest and very best regards,

    Mike

  11. #11
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: Calculating Missing Values in Number Series

    @mike.greene:

    if your problem has been resolved by JieJenn's solution, please consider adding to the reputation of JieJenn by clicking on the star below one of his posts above. also, please set your thread to 'SOLVED' by clicking on Edit in your first post, and selecting 'SOLVED' from the Suffix dropdown.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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