Page 389 - Excel 2013 All-in-One For Dummies
P. 389

For example, if you enter the following WEEKNUM function in a cell:
=WEEKNUM(DATE(2014,1,19))
Excel returns the number 4, indicating that the week containing the date January 19, 2014, is the fourth week in the year when the Sunday is consid- ered to be the first day of the week. (January 19, 2014, falls on a Sunday.) Note that if I had added 2 as the optional return-type argument, Excel would return 3 as the result because January 19, 2014, is deemed to fall on the last day of the third week of the year when Monday is considered the first day of the week.
WORKDAY
You can use the WORKDAY function to find out the date that is so many workdays before or after a particular date. This function takes the following arguments:
WORKDAY(start_date,days,[holidays])
The start_date argument is the initial date that you want used in calculating the date of the workday that falls so many days before or after it. The days argument is the number of workdays ahead (positive integer) or behind (negative integer) the start_date. The optional holidays argument is an array constant or cell range that contains the dates of the holidays that should be excluded (when they fall on a weekday) in calculating the new date.
For example, suppose that you want to determine a due date for a report that is 30 workdays after February 1, 2013, by using the same holiday sched- ule entered in the cell range B3:B13 in the Work Days 2013 workbook, shown in Figure 3-2. To do this, you enter the following formula:
=WORKDAY(DATE(2013,2,1),30,B3:B11)
Excel then returns the serial number 41351 to the cell, which then appears as March 18, 2013 (the day after St. Patrick’s Day), when you format it with the Short Date format.
YEARFRAC
The YEARFRAC (for Year Fraction) function enables you to calculate the fraction of the year, which is computed from the number of days between two dates. You can use the YEARFRAC function to determine the proportion of a whole year’s benefits or obligations to assign to a specific period.
The YEARFRAC function uses the following arguments:
YEARFRAC(start_date,end_date,[basis])
Using Date Functions 371
  Book III Chapter 3
 Date and Time Formulas


















































































   387   388   389   390   391