![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Join Date: Mar 2002
Location: Jackson, MI
Posts: 88
|
This is probably very basic, but:
I need to do the following: today's date minus birthdate = years of service.... thanks |
|
|
|
|
|
#2 | |
|
MrExcel MVP
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,448
|
Quote:
If birthdate is 3/1/81 and is entered in cell A1, then =year(today())-year(A1) will give you the age in years -- it may not necessarily give you the years of service ... Ha Ha! _________________ Yogi Anand Edit: Deleted inactive web site reference from hard coded signature [ This Message was edited by: Yogi Anand on 2003-01-19 15:00 ] |
|
|
|
|
|
|
#3 |
|
Join Date: Feb 2002
Location: Calgary, Alberta Canada
Posts: 1,761
|
To calculate the difference in years,
with Earliest Date in A1 and Latest date in B1, use =Datedif(A1,B1,"y") You could use today() for latest date. Note. Datedif is in most versions of Excel but it was only documented in Excel 2000. You can expand Datedif to show months, and days (Some anomalies with days). The following also includes text "Years" etc. =DATEDIF(A40,A38,"y")&" years, "&DATEDIF(A40,A38,"ym")&" months" [ This Message was edited by: Dave Patton on 2002-03-27 12:53 ] |
|
|
|
|
|
#4 | |
|
MrExcel MVP
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,448
|
Quote:
For resolving this mystery for me -- I know I could work with DATEDIF in Excel 97, but I couldn't find in the FUNCTION gallery! |
|
|
|
|
|
|
#5 |
|
Join Date: Mar 2002
Location: Wellington
Posts: 104
|
Hi Dave,
I have tried to find that DATEDIF function in Excel 97, but no luck. I guess my Excel version is not one of your "most versions" then. Thanks |
|
|
|
|
|
#6 |
|
MrExcel MVP
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,448
|
Hi BabyTiger:
Have you tried using the function in Excel 97 -- as I mentioned in my post, I was familiar that the function existed and I could use the function in Excel 97, but I could not find it in the function gallery, nor could I find help on this function within Excel 97. So, give it a shot and use the function -- you may be pleasantly surprised that it does exist -- it is just not documented! |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|