+ Reply to Thread
Results 1 to 9 of 9

URGENT - how do you do simple sums with cells set to date format

  1. #1
    Forum Contributor
    Join Date
    04-09-2014
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    250

    URGENT - how do you do simple sums with cells set to date format

    e.g.


    cell a1 = 19/11/1944
    cell a2 = =TODAY()

    how do I put a formula in cell a3 to calculate the difference between the two dates

    e.g.


    above example answer would be = 70
    Last edited by Muzza86; 06-25-2014 at 07:02 AM.

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: URGENT - how do you do simple sums with cells set to date format

    =A2-A1
    and make sure you format the formula cell as a number.

    Edit: should have read more closely as your question doesn't match your title. If you want the year difference you can use:
    =YEAR(A2)-YEAR(A1)
    You can also use DATEDIF if you want complete years elapsed between the two:
    =DATEDIF(A1,A2,"Y")
    but that will return 69, not 70.
    Last edited by romperstomper; 06-25-2014 at 06:38 AM.
    Remember what the dormouse said
    Feed your head

  3. #3
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: URGENT - how do you do simple sums with cells set to date format

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  4. #4
    Forum Contributor
    Join Date
    04-09-2014
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    250

    Re: URGENT - how do you do simple sums with cells set to date format

    im trying that but its not working. its strange.

    does it matter that my cells and dates are set to custom format of mm/dd/yyyy

    also I have several start dates of employee's . and im trying to do a sum to calculate how long they have been at the company. so I need to use =TODAY() into a cell

    e.g. something like =TODAY()-year(a1) ??

  5. #5
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: URGENT - how do you do simple sums with cells set to date format

    Define "not working".

  6. #6
    Forum Contributor
    Join Date
    04-09-2014
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    250

    Re: URGENT - how do you do simple sums with cells set to date format

    I have a column of cells with dates custom formatted to mm/dd/yyyy


    I have put a cell elsewhere on sheet with the =TODAY() formula


    e.g. exact example of whats happening... c5 = 01/03/1988 e8 = =TODAY()


    my formula in d5 is =year(e8)-year(c5)

    it shows.... 01/26/1990


    I need it to show... 26 years

  7. #7
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: URGENT - how do you do simple sums with cells set to date format

    As I said originally - format the formula cell as a number, not a date.

  8. #8
    Forum Contributor
    Join Date
    04-09-2014
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    250

    Re: URGENT - how do you do simple sums with cells set to date format

    oh thanks, yeah stupid of me.works

  9. #9
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: URGENT - how do you do simple sums with cells set to date format

    Dates in Excel are actually stored as serial numbers. Where 01/01/1900 has the serial number 1. To see this, input 1 in any cell in the sheet and format that cell as Date and the cell will show you now 01/01/1900. That is because excel is converting serial number to a date which is 01/01/1900. Same way if you input 26 in a cell and format it as a Date, it will show you 01/26/1900 (mm/dd/yyyy).
    So the formula is calculating correctly but different cell format will show you different output. Therefore as romperstomper said, format the formula cell as Number and it will show you the desired output.

    Hope this helps.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

+ 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] Pivot or VLOOKUP or INDEX - simple sums across rows...
    By silky_green in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-13-2013, 01:45 AM
  2. Simple Sums?
    By milly in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 12-23-2009, 07:30 AM
  3. Simple Question but need urgent help pls...
    By hendnov in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-12-2006, 09:15 AM
  4. Simple Question, display only part of a date in Number format
    By DB Explorer in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-17-2006, 07:50 AM
  5. Urgent simple formula help
    By pinehead in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-20-2006, 06:10 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