Discussion
In MS Excel, what does the DATEDIF function calculate?
Answer: A
Correct answer: The difference between two dates in years, months or days
DATEDIF returns the difference between two dates in the unit given by its third argument: "Y" for complete years, "M" for complete months, "D" for days, and the compound codes "YM", "YD" and "MD" for remainders. Its standard use is age: =DATEDIF(A1,TODAY(),"Y") gives completed years, which is what an age must be - simple subtraction and division by 365 goes wrong across leap years. It is a curiosity of Excel: inherited from Lotus 1-2-3, undocumented in the function list and absent from IntelliSense, but present in every version and fully supported. It must be typed in full. The other date functions are better documented. TODAY and NOW give the current date and time; DATE builds one from parts; EOMONTH finds the end of a month; WEEKDAY gives the day number; and NETWORKDAYS counts working days between two dates, excluding weekends and a supplied holiday list.
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development