+ Reply to Thread
Results 1 to 14 of 14

DATEDIF fx

Hybrid View

  1. #1
    Registered User
    Join Date
    01-15-2015
    Location
    Jackson MS
    MS-Off Ver
    2007
    Posts
    7

    Angry DATEDIF fx

    Hard to believe I am unable to get this right.
    I simply want to have column H show the days between "start date" column A and "sale date" column B, covering about 100 rows.
    Thanks in advance!
    Patrick

  2. #2
    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
    53,048

    Re: DATEDIF fx

    Hi, welcome to the forum

    A few questions...
    Are the dates real dates or just text looking like dates? Test with =ISNUMBER(cell-ref) FALSE = text
    What have you already tried, and what were the results?
    Can you upload a sample workbook, showing wjhat you have and what you want?

    A
    B
    C
    D
    1
    1/15/2015
    1/25/2015
    10 days

    D1=DATEDIF(A1,B1,"md")&" days"
    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

  3. #3
    Registered User
    Join Date
    01-15-2015
    Location
    Jackson MS
    MS-Off Ver
    2007
    Posts
    7

    Re: DATEDIF fx

    actual page.png

    false

  4. #4
    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
    53,048

    Re: DATEDIF fx

    Perhaps you missed this part...
    Can you upload a sample workbook, showing wjhat you have and what you want?

  5. #5
    Registered User
    Join Date
    01-15-2015
    Location
    Jackson MS
    MS-Off Ver
    2007
    Posts
    7

    Re: DATEDIF fx

    Hmmm....how do you "upload a sample workbook"? Is the uploaded pic not sufficient? I simply want column H to show days between a start date in column A and and end date in column B.

  6. #6
    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
    53,048

    Re: DATEDIF fx

    Sorry...
    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.

  7. #7
    Registered User
    Join Date
    01-15-2015
    Location
    Jackson MS
    MS-Off Ver
    2007
    Posts
    7

    Re: DATEDIF fx

    Ok....Hope this is correct
    Attached Files Attached Files

  8. #8
    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
    53,048

    Re: DATEDIF fx

    Thanks for the file.

    Did you try my formula from post #2?

  9. #9
    Registered User
    Join Date
    01-15-2015
    Location
    Jackson MS
    MS-Off Ver
    2007
    Posts
    7

    Re: DATEDIF fx

    yes....FALSE

  10. #10
    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
    53,048

    Re: DATEDIF fx

    It worked fo rme....
    A
    B
    C
    D
    E
    F
    G
    H
    1
    Date Listed
    Date Sold
    Desrciption
    Craigslist
    Starting Price
    Selling Price
    2
    1/4/2015
    1/5/2015
    Entertainment Center
    $ 60.00
    $ 60.00
    1 days
    3
    1/4/2015
    Massage Chair
    Leather Masage Chair
    $ 40.00
    Not Sold Yet
    4
    1/5/2015
    1/13/2015
    Arm Chair
    $ 10.00
    $ 10.00
    8 days
    5
    1/5/2015
    1/13/2015
    Stainless Steel Faucet
    $ 80.00
    $ 80.00
    8 days
    6
    1/5/2015
    1/12/2015
    Golf Couch
    $ 20.00
    $ 20.00
    7 days

    I modified it a bit to test for missing dates...
    H2=IF(B2="","Not Sold Yet",DATEDIF(A2,B2,"md")&" days")
    copied down

    (aahh wait, you probably either put that in H1, or in H2, but did not adjust the cell refs?)

  11. #11
    Registered User
    Join Date
    01-15-2015
    Location
    Jackson MS
    MS-Off Ver
    2007
    Posts
    7

    Re: DATEDIF fx

    I can get a simple formula to work for any single row, For instance, H2=B2-A2. I just want to apply this to all rows. Of course, I want to add what is necessary to generate an item not sold result when applicable.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    01-15-2015
    Location
    Jackson MS
    MS-Off Ver
    2007
    Posts
    7

    Re: DATEDIF fx

    It's working. That's awesome! How do you come of with the "code"? Surely not trial and error.?.?.?.?
    I greatly appreciate your help!!!

  13. #13
    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
    53,048

    Re: DATEDIF fx

    Quote Originally Posted by aperfectalibi View Post
    It's working. That's awesome! How do you come of with the "code"? Surely not trial and error.?.?.?.?
    I greatly appreciate your help!!!
    no, not quite This 1 is all based on...
    DATEDIF(A2,B2,"md")
    It takes the difference between the 2 dates (start date, end date) and expresses it as a numeric - I added Days to make it pretty

    Because not all rows have an "end" date, I added some error-trapping...
    =IF(B2="","Not Sold Yet",.....

  14. #14
    Registered User
    Join Date
    02-17-2015
    Location
    London, England
    MS-Off Ver
    Office 2013
    Posts
    2

    Re: DATEDIF fx

    This post has is very useful. Thank you Patrick and for the very helpful replies.

    The Datedif function is also very useful for accurately calculating age in years.
    See
    http://www.microsofttraining.net/tip...-function.html

+ 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. [SOLVED] Datedif
    By starksky in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-21-2014, 06:20 PM
  2. DateDif Average? Damn DateDif
    By UTCHELP in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 12-10-2012, 08:53 AM
  3. Excel 2007 : Datedif
    By mick2 in forum Excel General
    Replies: 2
    Last Post: 06-14-2010, 07:44 PM
  4. DateDif
    By vandanavai in forum Excel General
    Replies: 4
    Last Post: 01-30-2007, 12:42 PM
  5. [SOLVED] DateDIF
    By Paul Breslin in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-24-2005, 02:40 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