VBA-Excel: Date-Time Functions – WeekDay() and WeekDayName()

WeekDay()

Description:

The WeekDay function takes Date as a parameter and returns a number between 1 and 7, that is the week day of the date provided.

Format:

WeekDay (strDate [Firstdayofweek])

Arguments:

VBA-Excel: Get all the WeekDays or Working days in Specified Date Range, (excluding Satudays and Sundays)

This tutorial will teach you how to get all the working days or weekdays in a specified date range(excluding Satudays and Sundays), simple but very useful when you have come up with a excel where you have to work with all the business working days. Example: If the date range is mentioned between 8-Jan-2014 to … Read more VBA-Excel: Get all the WeekDays or Working days in Specified Date Range, (excluding Satudays and Sundays)

VBA-Excel: Date-Time Functions – DateSerial()

Description:

The DateSerial() function returns the Date type based on the parameters provided (year, month and date).

Format:

DateSerial(year,month,day)

Arguments:
    • Year
      • Manda­tory
      • Type: Numeric or Any Numeric Expression
      • Between 100 and 9999, values between 0-99 will be considered as 1900-1999

    Read moreVBA-Excel: Date-Time Functions – DateSerial()

    VBA-Excel: Date-Time Functions – DatePart()

    Description:

    The DatePart() function returns the part of given date based on the parameters provided.

    Format:

    DatePart(interval,date[,firstdayofweek[,firstweekofyear]])

    Arguments:
    • interval
      • Manda­tory
      • Type: String expression
      • The time interval you want as a part of given date

    Read moreVBA-Excel: Date-Time Functions – DatePart()

    VBA-Excel: Date-Time Functions – DateDiff()

    Description:

    The DateDiff() function returns the specified time interval difference between the two dates provided.

    Format:

    DateDiff(interval,date1,date2[,firstdayofweek[,firstweekofyear]])

    Arguments:
    • interval
      • Manda­tory
      • Type: String expression
      • The time interval you want the difference between two dates.

    Read moreVBA-Excel: Date-Time Functions – DateDiff()