Closed Thread
Results 1 to 4 of 4

maybe a VBA can solve this?

  1. #1
    Registered User
    Join Date
    02-01-2014
    Location
    Boston, Massachusetts
    MS-Off Ver
    Excel 2010
    Posts
    61

    maybe a VBA can solve this?

    I am trying to subtract two times from each other using the formula below. I do not want to count Saturday or Sunday and I have found a formula that works perfect when an item arrives Monday thru Friday. But, when the item arrives on Saturday at 5am and is finished processing on Monday at 5pm it says 1 day and 12 hours and when the item arrives on Saturday at 5pm it says 1 day. When the item arrives on the weekend count should stop.

    E13 is start day/time
    M13 is end day/Time
    F13 is start shift time
    N13 is end shift time

    =IF(AND(INT(E13)=INT(M13),NOT(ISNA(MATCH(INT(E13),
    HolidayList,0)))),"0 days 0 hours", IF(INT(E13)=INT(M13),
    "0 days " & ROUND(24*(M13-E13),2)&"hours",
    MAX(NETWORKDAYS(E13+1,M13-1,HolidayList),0)+
    INT(24*(((M13-INT(M13))-(E13-INT(E13)))+
    (N13-F13))/(24*(N13-F13)))&
    " days "&MOD(ROUND(((24*(M13-INT(M13)))-24*F13)+
    (24*N13-(24*(E13-INT(E13)))),2),
    ROUND((24*(N13-F13)),2))&" hours "))

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,713

    Re: maybe a VBA can solve this?

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: maybe a VBA can solve this?

    Edit: Alan beat me to it
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: maybe a VBA can solve this?

    Welcome to the Forum, unfortunately:

    This is a duplicate post and as such does not comply with Rule 5 of our forum rules. This thread will now be closed, you may continue in your other thread.

    Thread Closed.

    http://www.excelforum.com/excel-form...lp-needed.html

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Please solve this
    By loki7431 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-01-2013, 10:58 AM
  2. ****, How to solve this?
    By mwoerd in forum Excel General
    Replies: 2
    Last Post: 04-19-2012, 04:20 AM
  3. How do I solve for n in =4^n=64
    By dpiekarz in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-04-2006, 05:39 PM
  4. how to solve this?
    By jackoat in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-28-2006, 08:11 PM
  5. Solve:can this be done?
    By stuffandthings in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 02-15-2006, 11:55 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