+ Reply to Thread
Results 1 to 6 of 6

difference between two dates

  1. #1
    Registered User
    Join Date
    11-15-2011
    Location
    riyadh, ksa
    MS-Off Ver
    Excel 2007
    Posts
    3

    difference between two dates

    Hi... new here and need some help with my worksheet
    on column C, i need the difference (from date of admission and discharge) / i used the formula =datedif(d-c) and =d-c / all didnt work; also it would be best if the result highlights less than 2 days. On the column e, i would need the difference between discharge date and dictate date / much similar to the previous columns, and highlight the result of more than 30 days; so it will be easier to recognize the files that are incomplete.

    appreciate if anyone can help me out

    thank you
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    09-27-2011
    Location
    Poland
    MS-Off Ver
    Excel 2007
    Posts
    1,312

    Re: difference between two dates

    First of all You have to change the data format because You use text instead of data

    p.s. I've changed Your data now You can do calculations
    Attached Files Attached Files
    Last edited by tom1977; 11-15-2011 at 03:50 AM.
    Regards

    tom1977

    If You are satisfied with my solution click the small star icon on the left to say thanks.

  3. #3
    Registered User
    Join Date
    11-15-2011
    Location
    riyadh, ksa
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: difference between two dates

    Thanks tom1977
    yes, exactly what i need, but how come i applied it in my original worksheet, it doesnt work and gives me #VALUE!..
    does it have to with the data and text that you mentioned? how can i change it myself?
    really appreciate your help.

  4. #4
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: difference between two dates

    Col A and B are not dates but text looking like dates

    To adapt, select the data in Col A
    Go to Data - Text to columns
    Next - Next
    In the last window select DMY as Date format and Finish

    Same procedure for col B

    Col D is OK

    To check if it is text or note you can enter =ISTEXT(cell_with_date) in an empty cell
    If it returns TRUE, you know what to do

    Or, right click the dubious cell - Go to format cells - Click he Nimber tab - Click general.
    If it reads something like 40987 you're OK. If the date remains, you'll have to adapt


    EDIT also have a look at http://www.cpearson.com/excel/datetime.htm#AddingDates

  5. #5
    Forum Expert
    Join Date
    09-27-2011
    Location
    Poland
    MS-Off Ver
    Excel 2007
    Posts
    1,312

    Re: difference between two dates

    You have to use "text to columns" command on the ribbon to change the format. Unfortunately I have polish version of excel so it could be difficult to explain.

  6. #6
    Registered User
    Join Date
    11-15-2011
    Location
    riyadh, ksa
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: difference between two dates

    it says no specific number format

+ 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