+ Reply to Thread
Results 1 to 11 of 11

Calculating the Difference Between Two Dates

  1. #1
    Registered User
    Join Date
    07-15-2019
    Location
    London
    MS-Off Ver
    MS Office 2007
    Posts
    31

    Calculating the Difference Between Two Dates

    Hello,

    I need one formulae which only says 1 or 0, TRUE or FALSE.

    If the Request came 1 day after Created Date - say Yes (1), otherwise No (0).
    If the Request came 2 days after Created Date - say Yes (1), otherwise No (0).
    If the Request came 3 days after Created Date - say Yes (1), otherwise No (0).


    Thank you 😊
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,408

    Re: Calculating the Difference Between Two Dates

    Does this do what you want? Put this formula in cell C2 and copy it across to cell E2, then copy those three cells down to the bottom of your data...

    =$B2-$A2=COLUMNS($C:C)

  3. #3
    Registered User
    Join Date
    07-15-2019
    Location
    London
    MS-Off Ver
    MS Office 2007
    Posts
    31

    Re: Calculating the Difference Between Two Dates

    Yes, this works, but 'Request 1st Day' I'm gonna need something more..

    Here it takes the next day.. So it's true Request came 1 day after Created Date (Which is ok..)


    But sometimes Request Date is same as the Created day.

    Request 1st Day should take them both, current day of Created day + one day after.
    Request 2nd Day - is ok, two days after.
    Request 3rd Day - is ok, three days afer.
    Last edited by EHH; 09-02-2019 at 01:13 PM.

  4. #4
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,408

    Re: Calculating the Difference Between Two Dates

    I think this modified version of my formula should do what you want...

    =$B2-$A2=COLUMNS($C:C)-($B2=$A2)

  5. #5
    Registered User
    Join Date
    07-15-2019
    Location
    London
    MS-Off Ver
    MS Office 2007
    Posts
    31

    Re: Calculating the Difference Between Two Dates

    emm, nope!

    A4 and B4 is the current case on my attachment where Created Date is same as the Request Date.
    There C4 should be TRUE as well ://

    This way we loose no data, because if we only calculate the next day, 2 days after and 3 days afer.. we loose what we have on the current day of Created!!
    This is why Request 1st day should take them both, Created date and 1 day after..

    Hope I'm clear :§

  6. #6
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,408

    Re: Calculating the Difference Between Two Dates

    Quote Originally Posted by EHH View Post
    A4 and B4 is the current case on my attachment where Created Date is same as the Request Date.
    There C4 should be TRUE as well ://
    On the sample worksheet you posted in Message #1, A4 contains 8/25/2019 and B4 contains 8/28/2019... those are not the same date. As a matter of fact, none of the date combinations on the worksheet you posted start and end on the same date. I added one and the modified formula I posted seemed to work correctly for all of the example dates. Can you post a new example worksheet using my formula in Columns C:E and then show what you expected the result to be in Columns F:H so I can see what you are referring to?

  7. #7
    Registered User
    Join Date
    07-15-2019
    Location
    London
    MS-Off Ver
    MS Office 2007
    Posts
    31

    Re: Calculating the Difference Between Two Dates

    My mistake, I apologize.

    This one highlighted with green is an ex. This should say TRUE to the Request 1st day too (there we take the current day of Created date, and one day after)!

    Thank you for your help !! I appreciate it
    Attached Files Attached Files

  8. #8
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,408

    Re: Calculating the Difference Between Two Dates

    Quote Originally Posted by EHH View Post
    This one highlighted with green is an ex. This should say TRUE to the Request 1st day too (there we take the current day of Created date, and one day after)!
    No, it should not say TRUE anywhere on that row as the two dates are not the same... the one in cell A5 is 9/30/2019 and the one in cell B5 is 8/30/2019.

  9. #9
    Registered User
    Join Date
    07-15-2019
    Location
    London
    MS-Off Ver
    MS Office 2007
    Posts
    31

    Re: Calculating the Difference Between Two Dates

    Gosh!!
    Now I see I'm super tired. I have all day trying to figure this out, now I cannot even see!!

    Please edit it to same dates, 30.08.19 Created Date and Request Date as well... and help me out, make it apper there TRUE please

    I am very sorry!

  10. #10
    Registered User
    Join Date
    07-15-2019
    Location
    London
    MS-Off Ver
    MS Office 2007
    Posts
    31

    Re: Calculating the Difference Between Two Dates

    I have an excel of 17 sheets, with like 800 formulas all linked to the first Sheet!! So all of the results are gonna come up there together on diagrams and stuff..
    It makes me go crazzy bcuz I don't know much about excel!!

  11. #11
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,408

    Re: Calculating the Difference Between Two Dates

    Quote Originally Posted by EHH View Post
    Please edit it to same dates, 30.08.19 Created Date and Request Date as well... and help me out, make it apper there TRUE please
    Did you try my modified formula that I posted in Message #4 on it (after correcting the dates to be the same)? I am pretty sure it works the way you want.

+ 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. Calculating the Difference Between 2 Dates
    By jason_kelly in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-04-2011, 09:16 AM
  2. Calculating the difference between dates
    By matt20687 in forum Excel General
    Replies: 4
    Last Post: 07-12-2010, 05:05 PM
  3. Replies: 1
    Last Post: 07-12-2010, 02:41 PM
  4. Calculating difference between two dates
    By kwing in forum Excel General
    Replies: 9
    Last Post: 05-25-2010, 11:35 AM
  5. Calculating the difference in dates
    By ChrisVersion2 in forum Excel General
    Replies: 3
    Last Post: 11-17-2007, 03:48 PM
  6. calculating difference in months between 2 dates
    By RealEstateFinan in forum Excel General
    Replies: 3
    Last Post: 07-11-2007, 03:15 PM
  7. Calculating the difference between to dates
    By TheRook in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-19-2006, 07:15 AM
  8. Calculating the difference between dates
    By p-swart in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-15-2005, 05:27 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