This Excel tutorial explains how to use the Excel **WEEKDAY function** with syntax and examples.

The Microsoft Excel WEEKDAY function returns a number representing the day of the week, given a date value.

The syntax for the WEEKDAY function in Microsoft Excel is:

WEEKDAY( serial_number, [return_value] )

- serial_number
- A date expressed as a serial number or a date in quotation marks.
- return_value
Optional. It determines the day to use as the first day of the week in the calculations.

**Warning**: The*return_value*parameter accepts different values depending on whether you are using the WEEKDAY function as a worksheet function or a VBA function.#### Worksheet Function

The

*return_value*parameter, when used as a**worksheet function**, can be any of the following values:Value Explanation Version 1 Returns a number from 1 (Sunday) to 7 (Saturday).

This is the default if parameter is omitted.2 Returns a number from 1 (Monday) to 7 (Sunday). 3 Returns a number from 0 (Monday) to 6 (Sunday). 11 Returns a number from 1 (Monday) to 7 (Sunday). * Introduced in Excel 2010 12 Returns a number from 1 (Tuesday) to 7 (Monday). * Introduced in Excel 2010 13 Returns a number from 1 (Wednesday) to 7 (Tuesday). * Introduced in Excel 2010 14 Returns a number from 1 (Thursday) to 7 (Wednesday). * Introduced in Excel 2010 15 Returns a number from 1 (Friday) to 7 (Thursday). * Introduced in Excel 2010 16 Returns a number from 1 (Saturday) to 7 (Friday). * Introduced in Excel 2010 17 Returns a number from 1 (Sunday) to 7 (Saturday). * Introduced in Excel 2010 **Note:**Starting in Excel 2010, Microsoft has introduced new values for the*return_value*parameter when used as a worksheet function. You can now use 11 through 17 as valid parameters. This allows you to change the first day of the week to any day (Monday through Sunday).#### VBA Function

The

*return_value*parameter, when used as a**VBA function**, can be any of the following values:Value Explanation vbUseSystemDayOfWeek Returns a number from 1 to 7 and uses your system settings to determine the first day of the week vbMonday Returns a number from 1 (Monday) to 7 (Sunday). vbTuesday Returns a number from 1 (Tuesday) to 7 (Monday). vbWednesday Returns a number from 1 (Wednesday) to 7 (Tuesday). vbThursday Returns a number from 1 (Thursday) to 7 (Wednesday). vbFriday Returns a number from 1 (Friday) to 7 (Thursday). vbSaturday Returns a number from 1 (Saturday) to 7 (Friday). vbSunday Returns a number from 1 (Sunday) to 7 (Saturday).

The WEEKDAY function can be used in the following versions of Microsoft Excel:

- Excel 2013, Excel 2011 for Mac, Excel 2010, Excel 2007, Excel 2003, Excel XP, Excel 2000

The WEEKDAY function can be used in Microsoft Excel as the following type of function:

- Worksheet function (WS)
- VBA function (VBA)

Let's look at some Excel WEEKDAY function examples and explore how to use the WEEKDAY function as a worksheet function in Microsoft Excel:

Based on the Excel spreadsheet above, the following WEEKDAY examples would return:

=WEEKDAY(A1)Result:1 =WEEKDAY(A1, 1)Result:1 =WEEKDAY(A1, 2)Result:7 =WEEKDAY(A2)Result:5 =WEEKDAY(A3)Result:6 =WEEKDAY(38157)Result:7 =WEEKDAY("Apr 21, 2015")Result:3** Starting in Excel 2010, you can use 11 through 17 as the second parameter and change the first day of the week (in the calculations)=WEEKDAY(DATE(2015,3,15),11)Result:7(first day of the week is Monday)=WEEKDAY(DATE(2015,3,15),12)Result:6(first day of the week is Tuesday)=WEEKDAY(DATE(2015,3,15),13)Result:5(first day of the week is Wednesday)=WEEKDAY(DATE(2015,3,15),14)Result:4(first day of the week is Thursday)=WEEKDAY(DATE(2015,3,15),15)Result:3(first day of the week is Friday)=WEEKDAY(DATE(2015,3,15),16)Result:2(first day of the week is Saturday)=WEEKDAY(DATE(2015,3,15),17)Result:1(first day of the week is Sunday)

The WEEKDAY function can also be used in VBA code in Microsoft Excel.

Let's look at some Excel WEEKDAY function examples and explore how to use the WEEKDAY function in Excel VBA code:

Dim LWeekday As Integer LWeekday = Weekday("12/31/2001", vbSunday)

In this example, the variable called LWeekday would now contain the value of 2.

Question: Is there a LIKE function in Excel similar to the one in Access? I'm trying to write a formula equivalent to the following:

=if(D14 like "*Saturday*", Now()+2, Now()+1)

Where cell D14 is a date value formatted as *Saturday, August 27, 2005.*

Answer: Since your value in cell D14 is a date value, you can use the WEEKDAY function to determine which day of the week it is. In this case, you are looking for a Saturday. The WEEKDAY function will return a value of 7 when the date falls on a Saturday.

Try using the following formula:

=if(Weekday(D14)=7,Now()+2,Now()+1)

(scroll to see more)

- ABS (WS, VBA)
- ACCRINT (WS)
- ACCRINTM (WS)
- ACOS (WS)
- ACOSH (WS)
- ADDRESS (WS)
- AGGREGATE (WS)
- AMORDEGRC (WS)
- AMORLINC (WS)
- AND (WS)
- AND (VBA)
- AREAS (WS)
- ASC (VBA)
- ASIN (WS)
- ASINH (WS)
- ATAN (WS)
- ATAN2 (WS)
- ATANH (WS)
- ATN (VBA)
- AVEDEV (WS)
- AVERAGE (WS)
- AVERAGEA (WS)
- AVERAGEIF (WS)
- AVERAGEIFS (WS)
- BETA.DIST (WS)
- BETA.INV (WS)
- BETADIST (WS)
- BETAINV (WS)
- BIN2DEC (WS)
- BIN2HEX (WS)
- BIN2OCT (WS)
- BINOM.DIST (WS)
- BINOM.INV (WS)
- BINOMDIST (WS)
- CASE (VBA)
- CBOOL (VBA)
- CBYTE (VBA)
- CCUR (VBA)
- CDATE (VBA)
- CDBL (VBA)
- CDEC (VBA)
- CEILING (WS)
- CEILING.PRECISE (WS)
- CELL (WS)
- CHAR (WS)
- CHDIR (VBA)
- CHDRIVE (VBA)
- CHIDIST (WS)
- CHIINV (WS)
- CHITEST (WS)
- CHOOSE (WS, VBA)
- CHR (VBA)
- CINT (VBA)
- CLEAN (WS)
- CLNG (VBA)
- CODE (WS)
- COLUMN (WS)
- COLUMNS (WS)
- COMBIN (WS)
- COMBINA (WS)
- COMPLEX (WS)
- Concat with & (WS, VBA)
- CONCATENATE (WS)
- CONVERT (WS)
- COS (WS, VBA)
- COSH (WS)
- COUNT (WS)
- COUNTA (WS)
- COUNTBLANK (WS)
- COUNTIF (WS)
- COUNTIFS (WS)
- COVAR (WS)
- CSNG (VBA)
- CSTR (VBA)
- CURDIR (VBA)
- CVAR (VBA)
- DATE (WS)
- DATE (VBA)
- DATEADD (VBA)
- DATEDIF (WS)
- DATEDIFF (VBA)
- DATEPART (VBA)
- DATESERIAL (VBA)
- DATEVALUE (WS, VBA)
- DAVERAGE (WS)
- DAY (WS, VBA)
- DAYS360 (WS)
- DB (WS)
- DCOUNT (WS)
- DCOUNTA (WS)
- DDB (WS, VBA)
- DEGREES (WS)
- DGET (WS)
- DIR (VBA)
- DMAX (WS)
- DMIN (WS)
- DOLLAR (WS)
- DPRODUCT (WS)
- DSTDEV (WS)
- DSTDEVP (WS)
- DSUM (WS)
- DVAR (WS)
- DVARP (WS)
- ENVIRON (VBA)
- ERROR.TYPE (WS)
- EVEN (WS)
- EXACT (WS)
- EXP (WS, VBA)
- FACT (WS)
- FALSE (WS)
- FILEDATETIME (VBA)
- FILELEN (VBA)
- FIND (WS)
- FIX (VBA)
- FIXED (WS)
- FLOOR (WS)
- FOR...NEXT (VBA)
- FORECAST (WS)
- FORMAT Dates (VBA)
- FORMAT Numbers (VBA)
- FORMAT Strings (VBA)
- FREQUENCY (WS)
- FV (WS, VBA)
- GETATTR (VBA)
- GROWTH (WS)
- HLOOKUP (WS)
- HOUR (WS, VBA)
- HYPERLINK (WS)
- IF (WS)
- IF-THEN-ELSE (VBA)
- IFs (more than 7) (WS)
- IFs (up to 7) (WS)
- INDEX (WS)
- INDIRECT (WS)
- INFO (WS)
- INSTR (VBA)
- INSTRREV (VBA)
- INT (WS, VBA)
- INTERCEPT (WS)
- IPMT (WS, VBA)
- IRR (WS, VBA)
- ISBLANK (WS)
- ISDATE (VBA)
- ISEMPTY (VBA)
- ISERR (WS)
- ISERROR (WS, VBA)
- ISLOGICAL (WS)
- ISNA (WS)
- ISNONTEXT (WS)
- ISNULL (VBA)
- ISNUMBER (WS)
- ISNUMERIC (VBA)
- ISPMT (WS)
- ISREF (WS)
- ISTEXT (WS)
- LARGE (WS)
- LCASE (VBA)
- LEFT (WS, VBA)
- LEN (WS, VBA)
- LINEST (WS)
- LN (WS)
- LOG (WS, VBA)
- LOG10 (WS)
- LOOKUP (WS)
- LOWER (WS)
- LTRIM (VBA)
- MATCH (WS)
- MAX (WS)
- MAXA (WS)
- MDETERM (WS)
- MEDIAN (WS)
- MID (WS, VBA)
- MIN (WS)
- MINA (WS)
- MINUTE (WS, VBA)
- MINVERSE (WS)
- MIRR (WS, VBA)
- MKDIR (VBA)
- MMULT (WS)
- MOD (WS)
- MONTH (WS, VBA)
- MONTHNAME (VBA)
- N (WS)
- NA (WS)
- NETWORKDAYS (WS)
- NETWORKDAYS.INTL (WS)
- NOT (WS)
- NOW (WS, VBA)
- NPER (WS, VBA)
- NPV (WS, VBA)
- ODD (WS)
- OFFSET (WS)
- OR (WS)
- OR (VBA)
- PERCENTILE (WS)
- PERCENTRANK (WS)
- PERMUT (WS)
- PI (WS)
- PMT (WS, VBA)
- POWER (WS)
- PPMT (WS, VBA)
- PRODUCT (WS)
- PROPER (WS)
- PV (WS, VBA)
- QUARTILE (WS)
- RADIANS (WS)
- RAND (WS)
- RANDBETWEEN (WS)
- RANDOMIZE (VBA)
- RANK (WS)
- RATE (WS, VBA)
- REPLACE (WS)
- REPLACE (VBA)
- REPT (WS)
- RIGHT (WS, VBA)
- RND (VBA)
- ROMAN (WS)
- ROUND (WS)
- ROUND (VBA)
- ROUNDDOWN (WS)
- ROUNDUP (WS)
- ROW (WS)
- ROWS (WS)
- RTRIM (VBA)
- SEARCH (WS)
- SECOND (WS)
- SETATTR (VBA)
- SGN (VBA)
- SIGN (WS)
- SIN (WS, VBA)
- SINH (WS)
- SLN (WS, VBA)
- SLOPE (WS)
- SMALL (WS)
- SPACE (VBA)
- SPLIT (VBA)
- SQR (VBA)
- SQRT (WS)
- STDEV (WS)
- STDEVA (WS)
- STDEVP (WS)
- STDEVPA (WS)
- STR (VBA)
- STRCOMP (VBA)
- STRCONV (VBA)
- STRREVERSE (VBA)
- SUBSTITUTE (WS)
- SUBTOTAL (WS)
- SUM (WS)
- SUMIF (WS)
- SUMIFS (WS)
- SUMPRODUCT (WS)
- SUMSQ (WS)
- SUMX2MY2 (WS)
- SUMX2PY2 (WS)
- SUMXMY2 (WS)
- SWITCH (VBA)
- SYD (WS, VBA)
- T (WS)
- TAN (WS, VBA)
- TANH (WS)
- TEXT (WS)
- TIME (WS)
- TIMESERIAL (VBA)
- TIMEVALUE (WS, VBA)
- TODAY (WS)
- TRANSPOSE (WS)
- TRIM (WS, VBA)
- TRUE (WS)
- TRUNC (WS)
- TYPE (WS)
- UCASE (VBA)
- UPPER (WS)
- VAL (VBA)
- VALUE (WS)
- VAR (WS)
- VARA (WS)
- VARP (WS)
- VARPA (WS)
- VDB (WS)
- VLOOKUP (WS)
- WEEKDAY (WS, VBA)
- WEEKDAYNAME (VBA)
- WHILE...WEND (VBA)
- YEAR (WS, VBA)
- --- end ---

Home | About Us | Feedback | Sitemap

While using this site, you agree to have read and accepted our Terms of Service and Privacy Policy.

Copyright © 2003-2015 TechOnTheNet.com. All rights reserved.