+ Reply to Thread
Results 1 to 6 of 6

Due date and past due formula help please

  1. #1
    Registered User
    Join Date
    05-20-2017
    Location
    new jersey
    MS-Off Ver
    2010
    Posts
    18

    Due date and past due formula help please

    I am tasked with making a spread sheet showing the years, months, and days until a specific date. and then if its past due show the same but as a negative or some value to show it is past due.
    what i am using now is:
    =IF(DATEDIF(S4,N4,"y")=0,"",IF(DATEDIF(S4,N4,"y")=1,DATEDIF(S4,N4,"y")&"year",DATEDIF(S4,N4,"y")&"years"))&IF(AND(DATEDIF(S4,N4,"y")<>0,DATEDIF(S4,N4,"ym")<>0),", ","")&IF(DATEDIF(S4,N4,"ym")=0,"",IF(DATEDIF(S4,N4,"ym")=1,DATEDIF(S4,N4,"ym")&"month",DATEDIF(S4,N4,"ym")&" months"))&IF(AND(OR(DATEDIF(S4,N4,"y")<>0,DATEDIF(S4,N4,"ym")<>0),DATEDIF(S4,N4,"md")<>0),", ","")&IF(DATEDIF(S4,N4,"md")=0,"",IF(DATEDIF(S4,N4,"md")=1,DATEDIF(S4,N4,"md")&" day",DATEDIF(S4,N4,"md")&" days"))

    N4 is the objects due date and s4 is todays date. the problem I am having is when something is past due as in n4 is in the past. I am getting a number error. is there a way to eight get the years monts and days as a negative or some other value to show its in the past while still showing the time until one is due. Ive been racking my brain for a while now and im lost. thank you all

  2. #2
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: Due date and past due formula help please

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Due date and past due formula help please

    Agree a sample WB would help, but this is what I use to determine yrs/mths/days between 2 dates...
    =IF(DATEDIF(A1,B1,"y")=0,"",DATEDIF(A1,B1,"y")&" years ")&IF(DATEDIF(A1,B1,"ym")=0,"",DATEDIF(A1,B1,"ym")&" months ")&DATEDIF(A1,B1,"md")&" days"

    Now, yo ID those dates past due, you could use Conditional Formatting to make the cell change color when that even happens?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    05-20-2017
    Location
    new jersey
    MS-Off Ver
    2010
    Posts
    18

    Re: Due date and past due formula help please

    heres a sample
    Attached Files Attached Files

  5. #5
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Due date and past due formula help please

    Hi nub91- You need to format the result as text, and structure it like this:

    =IF($N$4=$S$4,"Due TODAY!",IF($N$4>$S$4,[Calculated Difference1]&" Remaining.",[Calculated Difference2]&" PAST DUE!"))

    where Calculated Difference is a place-keeper for all that code everybody else is writing.

    Since you're dealing w dates, N4 and S4 should be integers. Note that Calculated Difference1 uses N4-S4, while Calculated Difference2 uses S4-N4.
    If you want to HIGHLIGHT cells that are Past Due, use this Conditional Formatting Formula (in F2 and copy): =RIGHT(F2,4) = "DUE!"

    Please click the Add Reputation star below any helpful posts, and if you have your answer, mark your thread as SOLVED (Thread Tools up top). Thanks!-Lee
    Last edited by leelnich; 05-20-2017 at 03:10 AM.

  6. #6
    Forum Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Microsoft Office 2013
    Posts
    3,223

    Re: Due date and past due formula help please

    In "F2"
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    copy down.


    atul


    If my answer (or that of other members) has helped you, please say "Thanks" by clicking the Add Reputation button at the foot of one of their posts.

    Also: if your problem is solved, please take the time to mark your thread as SOLVED by going to the top of your first post, selecting "Thread Tools" and then "Mark thread as solved".

+ 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. Formula if cell is past certain date
    By Rookie11 in forum Excel General
    Replies: 1
    Last Post: 11-28-2016, 02:08 AM
  2. Replies: 11
    Last Post: 05-22-2015, 07:18 PM
  3. [SOLVED] Formula to delete date if its in the past?
    By Lehany in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-05-2015, 01:16 PM
  4. Replies: 4
    Last Post: 03-03-2014, 06:30 AM
  5. Formula to display last day of month if current day is past X date?
    By WL2005HBD in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-17-2013, 08:02 AM
  6. [SOLVED] Calculate total dollar amount the is past the past due date
    By Barb1980 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 11-12-2012, 05:34 PM
  7. Replies: 1
    Last Post: 09-30-2012, 03:01 PM

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