+ Reply to Thread
Results 1 to 4 of 4

Networkdays

  1. #1
    Registered User
    Join Date
    09-16-2020
    Location
    USA
    MS-Off Ver
    365
    Posts
    37

    Networkdays

    Hi,

    I am new to VBA/Macros and would like some to help me understand what is the equivalent of NETWORKDAYS(TODAY()-RC[-1],TODAY())" with SQL?
    is this to calculate only the business days (skip weekends and holidays?) the different between TODAY()-RC[-1] and Today() , but I don't understand what is TODAY()-RC[-1] means?

    Thank you

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Networkdays

    NETWORKDAYS gives you the number of working days. If you look it up in Excel help you will get an excellent description. The specific formula you showed gives the number of working days from yesterday to today. Note that if you want holidays to be excluded to you have a create of list of holidays and use them for the third argument, which is optional.

    I don't know what your question has to do with VBA or SQL.

    TODAY()-RC[-1]

    is an expression that uses the R1C1 form of cell addressing. It means to start with today's date, then subtract the number found in the cell in the same row and one column to the left of whatever cell this formula is in.

  3. #3
    Registered User
    Join Date
    09-16-2020
    Location
    USA
    MS-Off Ver
    365
    Posts
    37

    Re: Networkdays

    Thanks for your prompt response. The reason I post this message in VBA because I am reading the macro with VB script and not sure if NETWORKDAYS is from VB also. So with the formula I provided shows the number of working days from yesterday to day, it has nothing to do with holidays correct?

    Thanks

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Networkdays

    NETWORKDAYS is not a built-in VBA function. You can refer to Application.WorksheetFunction.Networkdays.

    The way you wrote the formula, it does not take into account holidays. This is what the formula looks like in B2, if you have a list of 8 holiday dates in column C:

    Formula: copy to clipboard
    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] Networkdays.intl vs networkdays
    By shukla.ankur281190 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-30-2015, 08:39 AM
  2. Networkdays help
    By ZOONY in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-14-2012, 09:08 PM
  3. Using NETWORKDAYS
    By j_Southern in forum Excel General
    Replies: 11
    Last Post: 01-16-2012, 09:30 AM
  4. Networkdays
    By Shakensoul in forum Excel General
    Replies: 3
    Last Post: 05-23-2009, 02:00 AM
  5. Networkdays
    By Emilio6s in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-20-2008, 04:52 AM
  6. [SOLVED] NETWORKDAYS
    By aristotle in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-06-2005, 06:05 AM
  7. NETWORKDAYS
    By sinbad in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 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