+ Reply to Thread
Results 1 to 12 of 12

Need FORMULA for Date subtract Date equal bussiness hour (don't count weekend)

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    818

    Re: Need FORMULA for Date subtract Date equal bussiness hour (don't count weekend)

    Hi,
    Can you help me to apply your formula
    (NETWORKDAYS(A1,B1))+MOD(B1-A1,1)
    into below macro:


    My current is:
    Target.Offset(0, 3).Value = Target.Offset(0, 0).Value - Target.Offset(0, -3).Value
    Please help me to modify by using your Formula:

    Target.Offset(0, 3).Formula = "=(NETWORKDAYS(A1,B1))+MOD(B1-A1,1)"
    
    Target.Offset(0, 0).Value   is   B1
    Target.Offset(0, -3).Value   is   A1
    Tried below but wrong:

    Target.Offset(0, 3).Formula = "=(NETWORKDAYS(" & Target.Offset(0, -3).Value & "," & Target.Offset(0, 0).Value & "))+MOD(" & Target.Offset(0, 0) & "-" & Target.Offset(0, -3) & ",1)"""
    Changes "Value" to "Address":
    Target.Offset(0, 3).Formula = "=(NETWORKDAYS(" & Target.Offset(0, -3).Address & "," & Target.Offset(0, 0).Address & "))+MOD(" & Target.Offset(0, 0).Address & "-" & Target.Offset(0, -3).Address & ",1)"


    Regards,
    tt3
    Last edited by tuongtu3; 05-23-2015 at 06:25 PM.

+ 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. Replies: 24
    Last Post: 10-08-2014, 10:31 AM
  2. Excel date without weekend count
    By Teuntja123 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-06-2014, 08:51 AM
  3. [SOLVED] Userform Textbox Date - Subtract Weekend
    By Nu2Java in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-12-2012, 05:14 PM
  4. Count by date and hour
    By ChristiaanV in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-11-2006, 07:30 PM
  5. [SOLVED] Cell colour chg when formula results equal a weekend day, i.e., "Saturday" and a date that falls on a Saturday?
    By StargateFanFromWork in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 09-19-2005, 08:15 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