+ Reply to Thread
Results 1 to 3 of 3

How to compensate for a second shift spread of data across two dates

  1. #1
    Registered User
    Join Date
    02-17-2014
    Location
    Florida
    MS-Off Ver
    Excel 2016
    Posts
    62

    How to compensate for a second shift spread of data across two dates

    Hi,

    I have a spreadsheet that totals data for two different shifts. On my "TOTALS" sheet it pulls the data from the "DATA ENTRY" sheet that matches criteria. I used Today() to pull the totals for each day. The problem is that second shift goes until about 3-4 AM and the Today() function won't show all the second shift data since the date rolls over. I compensate for this (in my real spreadsheet) by forcing it to use the previous days date if the time is between midnight and 5AM.

    My issue now is how to make the "TOTALS" data for 2nd shift see today's date totals as well as the next early mornings data from midnight until about 5AM. Also, it can only perform this if it's between midnight and 5 AM since it will always grab the previous mornings (midnight to 5am) otherwise.

    Thoughts on how to achieve this? I'm pretty good with VBA if that's a better way.

    Thank you for your time and assistance.

    SAMPLE WORKSHEET: Machine Data - 7-02-15.xlsb

    Jay

  2. #2
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,367

    Re: How to compensate for a second shift spread of data across two dates

    Perhaps something like this, using array formulas...


    regards
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    02-17-2014
    Location
    Florida
    MS-Off Ver
    Excel 2016
    Posts
    62

    Re: How to compensate for a second shift spread of data across two dates

    Thanks for the suggestion azumi, I ended up using a time check statement to see if it was between 12 midnight and 5 AM and if it was, subtract 1 day from the date being entered. This way the 2nd shift data will all be on one date instead of across two days. It works perfectly.

    The basic code is:

    Please Login or Register  to view this content.

+ 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. [SOLVED] macro to shift data to adjacent columns based on dates
    By hommeg in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-23-2015, 06:14 PM
  2. Replies: 0
    Last Post: 01-19-2015, 03:31 PM
  3. [SOLVED] Sum hours of each shift during given dates
    By bebo021999 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 04-07-2014, 10:54 AM
  4. Replies: 6
    Last Post: 06-19-2009, 09:17 AM
  5. How to spread out data based on dates and weeks.
    By c991257 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-24-2006, 10:45 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