+ Reply to Thread
Results 1 to 9 of 9

Find missing hours within a day

  1. #1
    Forum Contributor
    Join Date
    03-05-2018
    Location
    Tbilisi, Georgia
    MS-Off Ver
    2013, 2016
    Posts
    273

    Find missing hours within a day

    Hi, experts,
    I need to find missing hours from the date and hour range.
    There are a lot of tricks (in the internet) how to do it it with the missing numbers, however none of them works with hours.
    Is it possible to do this with formula the way given in the attached sample file?
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor janmorris's Avatar
    Join Date
    07-24-2021
    Location
    Japan
    MS-Off Ver
    Google Sheets (& Mac 2021)
    Posts
    1,142

    Re: Find missing hours within a day

    i have attached a sample using two different methods, EXCEL 2010+ (using AGGREGATE), and EXCEL <=2007 (using SMALL-IF-ISNA array)

    i hope it solves the issue

    sample formula using AGGREGATE:
    Please Login or Register  to view this content.
    sample formula using an array (CTRL+SHIFT+ENTER)
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by janmorris; 08-15-2021 at 04:26 AM.

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,917

    Re: Find missing hours within a day

    Sorry for off-topic interjection:

    Although there is no official rule regarding this behaviour, we request that wherever possible both the question AND the answer be provided in substantive detail here within the thread. An attached workbook is an excellent aid for posing a question and offering a solution, but solely doing that with no in thread explanation makes it difficult for researchers to understand or consider the Q & A of this thread without downloading what may be a pointless doc to them, if they can do that at all. Doing that also hides the content from search engines so others may never benefit from this.

    I'm sure you understand, and we look forward to seeing you post your formulas/macros in your posts for the searching benefit of all.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  4. #4
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Find missing hours within a day

    Without helper column.
    ARRAY formula in D2 copied down.
    Please Login or Register  to view this content.
    To enter ARRAY formula
    Copy and paste the formula in cell
    Press F2
    Press Ctrl+Shift+Enter together
    Excel covers the formula with {}.
    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.

  5. #5
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Find missing hours within a day

    With HELPER column F
    In F2 copied down

    =IF(($A$2+(ROW($A1)-1)/24)<=$A$16,$A$2+((ROW($A1)-1)/24),"")

    In G2 copied down

    =IFERROR(INDEX($F:$F,AGGREGATE(15,6,ROW($F$2:$F$22)/(COUNTIF($A$2:$A$16,$F$2:$F$22)=0),ROWS($G$2:$G2))),"")
    Attached Files Attached Files
    Last edited by kvsrinivasamurthy; 08-15-2021 at 05:07 AM.

  6. #6
    Forum Contributor
    Join Date
    03-05-2018
    Location
    Tbilisi, Georgia
    MS-Off Ver
    2013, 2016
    Posts
    273

    Re: Find missing hours within a day

    Good day janmorris and kvsrinivasamurthy.
    janmorris - your solution works, thank you.


    kvsrinivasamurthy, an option with the MMULT formula works exactly as needed, but another option with the helper extracts hours that are not missing. Pls. see attached file (extra hours marked with red).
    Attached Files Attached Files
    Last edited by T.I.; 08-15-2021 at 11:27 AM.

  7. #7
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Find missing hours within a day

    It is because of difference in the decimal places.
    Formula changed. Pl see file.
    Attached Files Attached Files

  8. #8
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,223

    Re: Find missing hours within a day

    Please try at D2

    =IFERROR(INT($A$2)+TIME(AGGREGATE(15,6,ROW($A$1:INDEX($A$1:$A$24,MAX(HOUR($A$2:$A$16))))-1/ISNA(MATCH(ROW($A$1:$A$24)-1,HOUR($A$2:$A$16),)),ROWS(D$2:D2)),,),"")
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    03-05-2018
    Location
    Tbilisi, Georgia
    MS-Off Ver
    2013, 2016
    Posts
    273

    Re: Find missing hours within a day

    kvsrinivasamurthy Works great now. Thank you.

    Bo_Ry Excellent, like always! Thank you too.

+ 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. Add missing hours and days in the data sheet
    By mostafa.elnazer in forum Excel General
    Replies: 8
    Last Post: 06-07-2021, 11:03 PM
  2. Replies: 9
    Last Post: 05-18-2021, 05:45 AM
  3. Replies: 2
    Last Post: 09-28-2020, 03:35 AM
  4. Replies: 17
    Last Post: 03-11-2020, 03:34 AM
  5. Insert Missing Hours
    By bwalshnl in forum Excel General
    Replies: 13
    Last Post: 02-27-2017, 11:03 AM
  6. [SOLVED] Find missing number and copy only missing number to another coloumn
    By vijaynadiad in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-20-2013, 02:01 PM
  7. Excel Macro to find missing dates and insert missing date as blank row
    By JevaMarie in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-26-2013, 11:08 AM

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