+ Reply to Thread
Results 1 to 2 of 2

Fill missing hours automatically excel

  1. #1
    Registered User
    Join Date
    08-17-2021
    Location
    greece
    MS-Off Ver
    office 2019
    Posts
    1

    Fill missing hours automatically excel

    Hi everybody,
    I'm working with an Excel file that should contain every second of a day and a value for every second. My problem is that there are some seconds missing (where the value should be zero). I've searched a lot on the web to find how to automatically create the missing cells for those missing hours and add blank cells in the value column, but I couldn't find an answer.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,082

    Re: Fill missing hours automatically excel

    Ok, here's one way

    24 hrs * 60 mins * 60 seconds
    24 * 60 * 60 = 86,400 seconds

    Time in Excel is held as an internal decimal number, a fraction of 1.00
    So 1 = a full day, 0.5 = 12noon
    More importantly 8:00am would be 0.3333 RECURRING. This may affect any MATCHes so you need to MATCH "hh:mm:ss" against "hh:mm:ss" for accuracy.


    1) Insert a column before column A

    2) in A1
    =TEXT(B1,"hh:mm:ss")
    copy this down as far as the number of rows you have, in your example 10624

    3) in D1
    =TEXT((ROW()-1)/86400,"hh:mm:ss")
    and copy down as far as row 86399

    4) in E1
    =IF(ISNA(MATCH(D1,A$1:A$10624,0)),0,INDEX(C$1:C$10624,MATCH(D1,A$1:A$10624,0)))
    and copy down as far as row 86399
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

+ 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. vba excel - optimizing loops fill missing minute data series PART II
    By terriertrip in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-30-2021, 04:21 PM
  2. [SOLVED] vba excel - optimizing loops fill missing minute data series
    By terriertrip in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-28-2021, 12:06 PM
  3. How make Excel automatically choose from a list off missing items
    By huginori in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-20-2020, 09:36 PM
  4. Replies: 17
    Last Post: 03-11-2020, 03:34 AM
  5. Fill In Missing Hourly Data Based on Input Date - Excel/VBA
    By bathtub2007 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-03-2018, 08:50 PM
  6. [SOLVED] how can i insert a blank row automatically into excel when a number is missing
    By seanduffy1 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 02-19-2013, 09:23 AM
  7. Excel 2007 : to fill missing data in excel
    By sureshdoranga in forum Excel General
    Replies: 1
    Last Post: 12-01-2009, 07:15 PM

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