+ Reply to Thread
Results 1 to 10 of 10

Formula to trace back to last time when numbers were at most one cell apart

  1. #1
    Registered User
    Join Date
    05-04-2018
    Location
    Hong Kong
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    38

    Formula to trace back to last time when numbers were at most one cell apart

    Dear Sir

    We have columns in an excel spreadsheet whereby some cells have numbers while also empty cells.

    We want the formula to trace back to the last time when the numbers in a column were at most one cell apart.

    There are two possible scenarios for this:

    1) there are numbers in consecutive cells; or

    2) the numbers are exactly 1 cell apart

    Please refer to the enclosed excel spreadsheet for illustration.

    Can you help us with suggesting a formula ?

    Thank you very much!
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    Excel 2016 (Win 10 - Work) & 365 Subscription (Win 10 - Home)
    Posts
    27,600

    Re: Formula to trace back to last time when numbers were at most one cell apart

    Please update your forum profile with the correct OFFICE version you are using (NOT Windows).

    I have looked at your attachment: it is not at all clear what you are trying to do. Where will I find your expected results, manually mocked up?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!

    STOP PRESS: Forum Rules Updated September 2018! Please read them here.
    Are you new to Power Query and don't know what to do with the code you've been given? Have a look here.
    Don't forget to say "thank you" to those who have helped you in your thread. If you wish, you can also reward them by clicking on their reputation star bottom left.

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Northern Ireland
    MS-Off Ver
    Excel 2013 & 2016
    Posts
    20,914

    Re: Formula to trace back to last time when numbers were at most one cell apart

    The expected answers are 1700 rows down!! They still don't make much sense to me, though. Why we needed to see 1700 rows when 10 or 20 would have been plenty is also a bit of a mystery.

    Lamlam... please explain exactly why 9 is your expected answer in C1760.
    Glenn



  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    Excel 2016 (Win 10 - Work) & 365 Subscription (Win 10 - Home)
    Posts
    27,600

    Re: Formula to trace back to last time when numbers were at most one cell apart

    Yes, a smaller sample set would make this easier to follow.

  5. #5
    Registered User
    Join Date
    05-04-2018
    Location
    Hong Kong
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    38

    Re: Formula to trace back to last time when numbers were at most one cell apart

    Hi
    Please refer to the enclosed file as revised. Hope this is understandable.
    I checked this can be opened in a Window 10 computer.
    The expected result is in Row 43 in this revised file.
    Attached Files Attached Files

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    Excel 2016 (Win 10 - Work) & 365 Subscription (Win 10 - Home)
    Posts
    27,600

    Re: Formula to trace back to last time when numbers were at most one cell apart

    Lamlam - please see post #2 where I asked you to do this:

    Please update your forum profile with the correct OFFICE version you are using (NOT Windows).
    We are not interested in your version of Windows - it is the version of Office you need to show. What is that?

  7. #7
    Forum Expert
    Join Date
    07-20-2011
    Location
    mysore
    MS-Off Ver
    Excel 2007
    Posts
    4,545

    Re: Formula to trace back to last time when numbers were at most one cell apart

    ARRAY formula in C43 then copied other cells
    Please Login or Register  to view this content.
    How ARRAY formula is entered

    Paste Formula in the cell.
    Press F2
    Hold Shift+ Ctrl Keys and hit Enter key.
    Now the formula is surrounded by {} by excel.
    Attached Files Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  8. #8
    Registered User
    Join Date
    05-04-2018
    Location
    Hong Kong
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    38

    Re: Formula to trace back to last time when numbers were at most one cell apart

    AliGW, sorry I mis-understood you. Update of my profile made.

    kvsrinivasamurthy, the formula is brilliant and seems to work well. Thank you very much!

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    Excel 2016 (Win 10 - Work) & 365 Subscription (Win 10 - Home)
    Posts
    27,600

    Re: Formula to trace back to last time when numbers were at most one cell apart

    Thanks for the update.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  10. #10
    Forum Expert
    Join Date
    07-20-2011
    Location
    mysore
    MS-Off Ver
    Excel 2007
    Posts
    4,545

    Re: Formula to trace back to last time when numbers were at most one cell apart

    Thanks for feed back.
    Last edited by kvsrinivasamurthy; Yesterday at 05:53 AM.

+ 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