+ Reply to Thread
Results 1 to 4 of 4

Calculating Days between dates

  1. #1
    Registered User
    Join Date
    05-21-2005
    Posts
    2

    Calculating Days between dates

    I have a date which I'm trying to calculate total number of days to the current date, but the date is in an uncommon format.

    20030822
    So the above number is in the yyyymmdd format. I have an entire column of numbers like these. How would I calculate how many days are there from that time to now?

  2. #2
    Forum Expert
    Join Date
    12-24-2004
    Location
    Sweden
    Posts
    1,256
    This is one option:
    Put this formula in the B Column, Format the column as General (not Date).
    =TODAY()-DATE(LEFT(A2,4),MID(A2,5,2),RIGHT(A2,2))

    Hope it helps
    Ola Sandström
    Last edited by olasa; 05-21-2005 at 12:51 PM.

  3. #3
    Registered User
    Join Date
    05-21-2005
    Posts
    2
    It's giving me incorrect calculation for certain dates, for example 20050223
    , I'm getting -2

  4. #4
    Forum Expert
    Join Date
    12-24-2004
    Location
    Sweden
    Posts
    1,256
    Sorry. MID(A2,3,2) was wrong. It should be MID(A2,5,2).
    /Ola

+ 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