+ Reply to Thread
Results 1 to 4 of 4

Populate cells based on date and time range selection

  1. #1
    Registered User
    Join Date
    06-18-2012
    Location
    rsa
    MS-Off Ver
    Excel 2007
    Posts
    18

    Populate cells based on date and time range selection

    hi there - this is something I have been struggling with for ages. Is it possible to be able to select a range of dates, and a time interval, and then to automatically fill in cells in a column? to be more specific, I want to be able to select, say 1 Jan 2013 to 31 dec 2013 in one box, then specify a time interval, for example "hourly" and then a column is populated with each interval, i.e. 1 jan 2013 00:00, and then the next one is 1 jan 2013 01:00 etc. I have tired the normal automatic fill tool but it never seems to get it right. It works for the first few days then it all goes funny.

    thanks in advance for the help
    Gary

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: Populate cells based on date and time range selection

    The source of problem is the way Excel stores date/time (floating point double precision value).
    Easy way to avoid "funny numbers" down below would be by using formula.
    for instance if first date is in C5 in C6 write
    =$C$5+WIERSZ(A1)/24
    to have hourly interval
    and copy down -> worth considering way to do it:
    HTML Code: 
    of course for starting date in A1 use:
    =$A$1+WIERSZ(A1)/24

    for 10 minutes intervals
    =$C$5+WIERSZ(A1)/144

    etc.

    Once you like the output it would be good idea to copy and paste as values all cells within the range, because every (even so simple) formula slows down excel a tiny bit.
    1000 such formulas you will not notice. But if you have several worksheets with tens thousands - it will finally slow down.
    Last edited by Kaper; 03-10-2014 at 07:34 AM.
    Best Regards,

    Kaper

  3. #3
    Registered User
    Join Date
    06-18-2012
    Location
    rsa
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Populate cells based on date and time range selection

    Hi Kaper,

    thanks for the response. this doesn't seem to work in my Excel though? it just returns "#NAME?". it seems the function WIERSZ isn't recognised. Any ideas?

  4. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: Populate cells based on date and time range selection

    Whoops, it is from national version.
    sorry for that

    WIERSZ is just ROW, so:

    =$C$5+ROW(A1)/24
    =$C$5+ROW(A1)/144
    etc.

+ 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. Auto-populate a range based on active selection with data from another sheet
    By nomwich in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-14-2013, 04:31 AM
  2. Replies: 5
    Last Post: 01-10-2013, 06:22 PM
  3. Populate cells based on the selection from a drop down box
    By bartow in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-13-2011, 03:27 PM
  4. [SOLVED] Auto populate several cells based on a selection from drop down li
    By Sheldon in forum Excel General
    Replies: 3
    Last Post: 01-13-2006, 04:30 PM
  5. Replies: 1
    Last Post: 05-18-2005, 06:06 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