+ Reply to Thread
Results 1 to 5 of 5

Calculating Total Time

  1. #1
    Registered User
    Join Date
    08-05-2007
    Posts
    9

    Calculating Total Time

    Thanks in advance for any help this community can provide. I've been tasked to come up with an excel sheet that does two main functions. I've been able to complete the first but the second one is really giving me a hard time.

    Basically I need to take the start date for each employee and display the total number of days they have been affiliated with the company. For example I started 05/28/96 so I have 11 years, 10 months, XX days. I have been able to do this using VBA (but if I could figure out a way to get rid of the #VALUE that would be awesome).

    The next thing that I need to do that I need help with is take everyone's total time that they have been working at the company and add it together. Ultimate goal is to show the total experience that can be utilized.

    There is one requirement. The date format HAS to be entered in yyyymmdd format. If you look at my example I couldn't figure out how to get EXCEL to deal with this so I converted it using Column C. This column will probably be hidden from the end user.

    I have attached a copy of my working example. If anyone could help me accomplish this it would be awesome. I'm open to suggestions if anyone has a better idea then using the VBA that I have here.
    Attached Files Attached Files

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Maybe like this:
    Please Login or Register  to view this content.
    C3 and down: =VALUE(TEXT(B3, "0000-00-00"))

    D3 and down: =DATEDIF(C3, $A$1, "y") & " yrs " & DATEDIF(C3, $A$1, "ym") & " mos " & DATEDIF(C3, $A$1, "md") & " days"

    C15 (array formula): =TODAY() - SUM(TODAY() - C3:C12)

    D15: =DATEDIF($A$1, C15, "y") & " yrs " & DATEDIF($A$1, C15, "ym") & " mos " & DATEDIF($A$1, C15, "md") & " days"

  3. #3
    Registered User
    Join Date
    08-05-2007
    Posts
    9
    Thanks a TON. This is perfect. EXACTLY what I needed. I have one more question though. I can't get the formula in D15 to work. I keep getting the #NUM! error.

    Any ideas on what I'm doing wrong. I've attached my working document for reference.
    Attached Files Attached Files

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464
    Quote Originally Posted by SailorGuy
    Thanks a TON. This is perfect. EXACTLY what I needed. I have one more question though. I can't get the formula in D15 to work. I keep getting the #NUM! error.

    Any ideas on what I'm doing wrong. I've attached my working document for reference.
    If you just need the total experience expressed as a number of days, inclusive of the first and last day then use:
    Please Login or Register  to view this content.
    similarly if you need each person's service in days use:
    Please Login or Register  to view this content.
    The simple number of days, rather than text describing the service, may be easier to work with in any future analysis.

    Rgds


    HTH

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    Hello Sailor,

    If C15 is a date in the past (which it will be given the suggested formula) then the dates would need to be reversed in the DATEDIF functions in D15. That approach, however, would limit the total to approx 108 years so I suggest changing C15 to this formula

    =(COUNT(C3:C12)+1)*TODAY()-SUM(C3:C12)

    This will give a future date and D15 formula should work unchanged


    .....or, without any formula in C15 just use this formula in D15

    =DATEDIF(0,SUMPRODUCT(TODAY()-C3:C12), "y") & " yrs " & DATEDIF(0,SUMPRODUCT(TODAY()-C3:C12),"ym") & " mos " & DATEDIF(0,SUMPRODUCT(TODAY()-C3:C12), "md") & " days"
    Last edited by daddylonglegs; 03-31-2008 at 05:35 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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