WEEKDAY, WEEKNUM, and YEARFRAC Date Functions
Excel's more sophisticated Date functions, WEEKDAY, WEEKNUM, and YEARFRAC on the Date and Time button's drop-down menu.
- Use the Date Formulas worksheet in Date Function Practice.xlsx workbook file you
created when doing the previous exercise.
You will start by creating a formula in cell F3 that uses the WEEKDAY function to return the day of week of the date entered in cell E3. - With the cell cursor in cell F3, select the WEEKDAY function on the Date and Time
button's drop-down menu. Then, click cell E3 to enter this cell address in the
Serial_number argument text box and press Tab to select the Return_type text box.
Then, type 2 in this text box and click OK to close the WEEKDAY Function
Arguments dialog box.
Excel returns 2 to cell F3, indicating that this date in 1949 fell on a Tuesday (when you select 2 as the return_type, 1 is Monday, 2 is Tuesday, 3 is Wednesday, 4 is Thursday, 5 is Friday, 6 is Saturday, and 7 is Sunday). - Use the Fill handle to copy this formula with the WEEKDAY function down to the
cell range F4:F8.
Next, you will use the WEEKNUM Date function to determine the number of the week of each date entered in the range B10:B14. - Click cell C10 and then select the WEEKNUM function on the Date and Time button's
drop-down menu. Click cell B10 to enter this address in the Serial_number text box
and press Tab and type 2 in the Return_type text box before you click OK to close
the WEEKNUM's Function Arguments dialog box.
Excel returns 7 to cell C10, indicating that February 7th fell in the 7th week of 1989 when you designate Monday as the first day of the week. - Copy the WEEKNUM formula in cell C10 down to the cell range C11:C14.
Next, you will use the YEARFRAC Date function to determine what fractional part of a year the number of days elapsed between two dates represents. - Click C17 and select the YEARFRAC function at the very bottom of the Date and Time
button's drop-down menu. Click cell A17 to enter this address in the Start_date text
box. Then, press Tab and click cell B17 to enter its address in the End_date text
box. Finally, press Tab and then type 3 in the Basis text box before you click OK to
close the WEEKNUM's Function Arguments dialog box.
Excel returns 0.2 to cell C17. - Format the result in cell C17 with the Number format on the drop-down menu
attached to the Number Format command button on the Ribbon's Home tab. Use
the Fill handle to copy this formula down to the cell range C18:C19.
Now you are ready to check your formulas and their answers before you save your work. - Check your answers against those shown in the Date Formulas sheet in the Solved8-3.xlsx workbook file in your Chap8 subfolder in the Excel 2007 Workbook folder. When everything checks out, save your changes to the Date Function Practice.xlsx workbook (Ctrl+S) and then close the workbook.
In this tutorial:
- Date and Time Formulas in Excel
- Constructing Date and Time Formulas
- Building Formulas that Calculate Dates and Times
- Working with Simple Date Functions
- TODAY, NOW, DATE, and DATEVALUE Date Functions
- Working with Excel's More Date Functions
- WEEKDAY, WEEKNUM, and YEARFRAC Date Functions
- Working with the Time Functions
- Building Formulas with Common Time Functions