Practical – 125 : Any 5 Date Related Function with Example in Excel..

Practical-125

  1. DATEDIF: 
  • Calculates the difference between two dates (start date and end date) in days, months, or years.
  • Syntax: =DATEDIF(start_date, end_date, unit)
  • unit can be “d” for days, “m” for months, or “y” for years.
  • Example: To calculate the number of years between two dates, you would use =DATEDIF(start_date, end_date, “y”).
  1. EDATE: 
  • Returns a date that is a specified number of months before or after a given start date.
  • Syntax: =EDATE(start_date, months)
  • months is the number of months to add or subtract from the start_date.
  • Example: To find the date 6 months after a given date, you would use =EDATE(start_date, 6).
  1. EOMONTH: 
  • Returns the last day of the month before or after a specified number of months from a given date.
  • Syntax: =EOMONTH(start_date, months)
  • months is the number of months to add or subtract from the start_date.
  • Example: To find the last day of the current month, you would use =EOMONTH(TODAY(), 0).
  1. NETWORKDAYS: 
  • Calculates the number of workdays (excluding weekends and holidays) between two dates.
  • Syntax: =NETWORKDAYS(start_date, end_date, [holidays])
  • [holidays] is an optional argument that can be used to specify a range of cells containing holidays to be excluded from the calculation.
  • Example: To calculate the number of workdays between two dates, you would use =NETWORKDAYS(start_date, end_date).
  1. WORKDAY: 
  • Returns a date that is a specified number of workdays before or after a given start date.
  • Syntax: =WORKDAY(start_date, days, [holidays])
  • days is the number of workdays to add or subtract from the start_date.
  • [holidays] is an optional argument that can be used to specify a range of cells containing holidays to be excluded from the calculation.
  • Example: To find a date 5 workdays after a given date, you would use =WORKDAY(start_date, 5).
  1. DATEVALUE: 
  • Converts a date in text format to a serial number that Excel can use for calculations.
  • Syntax: =DATEVALUE(date_text)
  • date_text is a text string representing the date.
  • Example: To convert a date in text format (e.g., “12/25/2023”) to a serial number, you would use =DATEVALUE(“12/25/2023”)