+ Reply to Thread
Results 1 to 8 of 8

Nested if with today function and datedif function

  1. #1
    Registered User
    Join Date
    02-25-2016
    Location
    South Africa
    MS-Off Ver
    Office 365 vs 2406
    Posts
    26

    Nested if with today function and datedif function

    I need help please.

    I have a estimated date and and actual date. The objective is to see how many days difference is there between my Estimated Date (R8) and my Actual date (S8), however sometimes there is no date in the Actual date (S8)

    R8 has the first date in it and S8 has the Actual date in it - sometimes the actual date occurs borfore the estimated date, the problem I am getting is that it renturns #Num when this occurs. (Somtimes is doesn't have a date and the cell is empty, hence my S8="")

    I would like it to have a 0 if this occurs. If I didn't have the today portion first then I wouldn't have a problem, but I just can't work out where to put the iserror function to solve this.

    This is the formulas so far and it works great except when the date occurs before the date in R8

    =IF(S8="",TODAY()-R8,DATEDIF(R8,S8,"D"))

    Your help would be very much appreciated.

  2. #2
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,941

    Re: Nested if with today function and datedif function

    please attach a sample excel file with expected result
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  3. #3
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,176

    Re: Nested if with today function and datedif function

    Try this ...

    =IF(S8="",TODAY(),S8)-R8

  4. #4
    Registered User
    Join Date
    02-25-2016
    Location
    South Africa
    MS-Off Ver
    Office 365 vs 2406
    Posts
    26

    Re: Nested if with today function and datedif function

    I have attached a sample.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    02-25-2016
    Location
    South Africa
    MS-Off Ver
    Office 365 vs 2406
    Posts
    26

    Re: Nested if with today function and datedif function

    Thank you - can you explain the formula to me please.

  6. #6
    Registered User
    Join Date
    02-25-2016
    Location
    South Africa
    MS-Off Ver
    Office 365 vs 2406
    Posts
    26

    Re: Nested if with today function and datedif function

    This is a new sample

    When the dates are the same the result is 0, but instead of 0, i need it to say "On Order"
    Attached Files Attached Files
    Last edited by KIMMEYER; 12-06-2016 at 09:43 AM.

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,823

    Re: Nested if with today function and datedif function

    Try

    =IF(AND(H2<>"",G2=H2),"On Order",IF(H2="",TODAY(),H2)-G2)

  8. #8
    Registered User
    Join Date
    02-25-2016
    Location
    South Africa
    MS-Off Ver
    Office 365 vs 2406
    Posts
    26

    Re: Nested if with today function and datedif function

    Thanks you so so much, that worked very well.

+ 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. Replies: 10
    Last Post: 09-06-2023, 08:19 PM
  2. Replies: 4
    Last Post: 08-24-2016, 09:29 AM
  3. Calling function inside function. (aka nested function)
    By jakopak in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-02-2015, 05:58 AM
  4. Use DATEDIF function in getting Age
    By IMA_Saihat in forum Tips and Tutorials
    Replies: 10
    Last Post: 04-10-2015, 01:34 PM
  5. #NUM! while using DATEDIF function
    By sriradh in forum Excel General
    Replies: 3
    Last Post: 08-22-2008, 03:21 PM
  6. nested DATEDIF funtion in IF function...
    By Excel_Gent in forum Excel General
    Replies: 3
    Last Post: 11-07-2007, 04:11 PM
  7. DateDif Function
    By The Muffin Man in forum Excel General
    Replies: 2
    Last Post: 09-06-2007, 06:35 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