+ Reply to Thread
Results 1 to 9 of 9

Formaula Explanation

  1. #1
    Registered User
    Join Date
    04-03-2018
    Location
    USA
    MS-Off Ver
    2016
    Posts
    4

    Formaula Explanation

    Can anyone please explain what this formula is trying to calculate.


    D1958 E1958
    03-16-2018 11:17 AM 03-20-2018 10:33 AM


    =IFERROR((NETWORKDAYS(D1958,E1958)-1)*("20:00"-"6:00")+IF(NETWORKDAYS(E1958,E1958),MEDIAN(MOD(E1958,1),"20:00","6:00"),"20:00")-MEDIAN(NETWORKDAYS(D1958,D1958)*MOD(D1958,1),"20:00","6:00"),"")
    Last edited by CHExcel101; 04-03-2018 at 01:16 PM.

  2. #2
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Formaula Explanation

    Hello and welcome to the forum.

    Just from a quick glance, it looks like the formula was built to count the number of "network hours" between two dates.

    That is, count the number of hours between two dates not including weekends or non-work hours.

  3. #3
    Registered User
    Join Date
    04-03-2018
    Location
    USA
    MS-Off Ver
    2016
    Posts
    4

    Re: Formaula Explanation

    Yes, I got that part. Breaking down the formula:

    ("20:00-"6:00") = 0.58
    IF(NETWORKDAYS(E1958,E1958),MEDIAN(MOD(E1958,1),"20:00","6:00"),"20:00") = 0.71
    MEDIAN(NETWORKDAYS(D1958,D1958)*MOD(D1958,1),"20:00","6:00") = 0.47

    This is the part I don't understand. The overall idea behind the formula is to calculate the network days but it is these small constraints to the formula that I am not able to follow.

  4. #4
    Registered User
    Join Date
    04-03-2018
    Location
    USA
    MS-Off Ver
    2016
    Posts
    4

    Re: Formaula Explanation

    What does ("20:00-"6:00") = 0.58 mean? Is it 10hours?

  5. #5
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Formaula Explanation

    I was answering this question directly:
    Can anyone please explain what this formula is trying to calculate.
    After reading post #3, it looks like you're asking how the formula works, not what it is calculating.

    Keep in mind that I am assuming that it works in the first place.

    Let's take the second section from post #3. Work from the inside out.

    MOD(E1958,1) returns only the decimal value of E1958. In Excel, dates and times are stored as numbers. Let's say E1958 = 4/3/2018 1:20 PM (which is 43193.56).
    MOD(E1958,1) = 0.56, 20:00 = 0.83, and 6:00 = 0.25 so we have MEDIAN(0.56,0.83,0.25) = 0.56

    An IF function is structured as follows: =IF(logical_test, value_if_true, value_if_false)
    If the NETWORK days function returns a value of 0 (which is FALSE inside the IF function), then return 20:00, otherwise if anything other than 0 is returned, return the median value.

    All that being said, I don't see the point of NETWORKDAYS(E1958,E1958). This will always return 0.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,869

    Re: Formaula Explanation

    No, it's 14 hours (20:00 minus 6:00). 0.58 is the same as 14/24.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  7. #7
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Formaula Explanation

    Quote Originally Posted by CHExcel101 View Post
    What does ("20:00-"6:00") = 0.58 mean? Is it 10hours?
    6:00 = 6:00 AM
    20:00 = 8:00 PM

    6:00 AM to 8:00 PM is 14 hours which is 58/100 or 14/24 or 0.58 of a day.

  8. #8
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Formaula Explanation

    Here's something worth checking out.

    Link here: https://www.exceltactics.com/calcula...g-networkdays/

  9. #9
    Registered User
    Join Date
    04-03-2018
    Location
    USA
    MS-Off Ver
    2016
    Posts
    4

    Re: Formaula Explanation

    So, this part (NETWORKDAYS(D1958,E1958)-1)*("20:00"-"6:00") means 2days into 14hours (2*0.58) = 1.16 days ?
    Am I understanding this correctly?

+ 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] Invoice Log - Formaula Help
    By kriscons in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-15-2017, 01:24 PM
  2. Replies: 4
    Last Post: 01-09-2017, 10:56 AM
  3. Looking for a formaula that will look up a food cycle
    By dinoo1 in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 01-08-2017, 08:13 PM
  4. formaula problem
    By lsapp289 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-12-2013, 03:07 AM
  5. Excel Formaula
    By timmycl_7 in forum Excel General
    Replies: 1
    Last Post: 06-11-2008, 07:08 AM
  6. [SOLVED] insert rotating formaula
    By Rich Mcc in forum Excel General
    Replies: 2
    Last Post: 03-14-2006, 09:25 AM
  7. [SOLVED] Formaula to multiply and add
    By Frank Malone in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-05-2006, 05:55 AM

Tags for this Thread

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