+ Reply to Thread
Results 1 to 2 of 2

Manipulating dates outputs with criteria

  1. #1
    Registered User
    Join Date
    05-16-2011
    Location
    Halifax, Nova Scotia
    MS-Off Ver
    Excel 2007
    Posts
    1

    Manipulating dates outputs with criteria

    I have a folmula but need help editing it. The way the formula works now is, I enter a start date and an end date and it give me the result as so: 3 years, 5 months, 17 days

    What I am trying to accomplish is to put a bit more logic in so that it would read the dates and if the days were greater than 10, it would add another month. So, it would actually read: 3 years 6 months.

    Below is the formula:

    =YEAR(C10)-YEAR(B10)-IF(OR(MONTH(C10)<MONTH(C10),AND(MONTH(C10)=MONTH(B10),DAY(C10)<DAY(B10))),1,0)&" years, "&MONTH(C10)-MONTH(B10)+IF(AND(MONTH(C10)<=MONTH(B10),DAY(C10)<DAY(B10)),11,IF(AND(MONTH(C10)<MONTH(B10),DAY(C10)>=DAY(B10)),12,IF(AND(MONTH(C10)>MONTH(B10),DAY(C10)<DAY(B10)),-1)))&" months, "&NETWORKDAYS(C10-(C10-DATE(YEAR(C10),MONTH(C10)-IF(DAY(C10)<DAY(B10),1,0),DAY(B10))),C10)&" days"

    If you enter March 7, 1971 as a start date in B10 and August 29, 1974 in C10 you will get the result.

    Any help would be greatly appreciated.
    Last edited by NBVC; 05-16-2011 at 04:17 PM. Reason: Manipulating dates outputs with criteria

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: can't get the formula to work

    Wondering if this will work:

    Please Login or Register  to view this content.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

+ 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