I m not able to calculate exact number of years months and days seperately between to dates. Pls help.
I m not able to calculate exact number of years months and days seperately between to dates. Pls help.
Can you give an example? With start date in A2 and end date in B2 you can use DATEDIF to give years, months and days altogether
=DATEDIF(A2,B2,"y")&" years "&DATEDIF(A2,B2,"ym")&" months "&DATEDIF(A2,B2,"md")&" days"
or do you want those in separate cells? If so just use each DATEDIF element on its own
Audere est facere
Thanx for the formula
I had pasted the formula suggested by you i.e.
=DATEDIF(B2,A2,"y")&" years "&DATEDIF(B2,A2,"ym")&" months "&DATEDIF(B2,A2,"md")&" days"
but unfortunately result was :
#NUM!
Can you kindly attach a excel sheet with an example, say A2 : 02-06-1976 & B2 : 01-01-2013
Are the dates you are working with, actually dates/values, or text that looks like dates? test with =isnumber(cell-ref) FALSE means text
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
I had tested with =isnumber(cell-ref) result is TRUE.
click on the cell with the formula in it, and press F2. look at where the references are pointing. Are they all where they need to be, based on where you're data is? If not, adjust as needed.
If this still doesnt work, i would suggest you upload a sample work book, (all sensitive data removed), showing what data you are working with, a few examples of what your expected outcome is, and how you arrived at that
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.
Thanks DDL, I didnt think of that
I had attached the file (gratuity calculator.xls)
Note that in DATEDIF (earlier date, later date,...)
Quang PT
as pointed out it needs to be
=DATEDIF(H3,I3,"y")&" years "&DATEDIF(H3,I3,"ym")&" months "&DATEDIF(H3,I3,"md")&" days"
gives
30 years 5 months 8 days
"Unless otherwise stated all my comments are directed at OP"
Mojito connoisseur and now happily retired
where does code go ?
look here
how to insert code
how to enter array formula
why use -- in sumproduct
recommended reading
wiki Mojito
how to say no convincingly
most important thing you need
Martin Wilson: SPV
and RSMBC
Thanx to you all. It worked. Thanx to all once again.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks