To count by week number is a bit different than by month. Instead of finding the start and end dates of the date range, we focus on exact week number using the WEEKNUM function.
=COUNTIFS( range of week number helper column, current week number)
- Add a helper column near your table.
- On the helper column, use the WEEKNUM function with actual dates =WEEKNUM(B3)
- Go to results table with week numbers
- Start with =COUNTIFS(
- Continue with criteria range – criteria pair with week range and week number for first row (i.e. $D$3:$D$10,F3)
- Type in ) to close the COUNTIFS function and press Enter to complete the formula
The COUNTIFS function counts the values that meet any number of criteria. Instead of filtering dates in a month, we get help from the WEEKNUM function, which simply returns the week number of a specified date. So, the first step is to add a helper column to convert actual dates to week numbers.
From here on, all we need to do is a COUNTIFS calculation (or even COUNTIF in this case, because we have only single criteria, week number). The COUNTIFS arguments are 'criteria range' – 'criteria' pairs. Because we have a single criteria, we're going to use 2 arguments.
Please pay attention to absolute references on values and criteria range. They should remain the same as we copy down our formula from week 44 to 47. The Criteria argument has relative reference because we want it to be updated through rows.
Thanks to formatting options of Excel, we can display week numbers with a "Wk" perfix. Adding custom format "Wk 0" to a number adds "Wk" text at front of number. To apply a custom format:
- Select the cell to be formatted and press Ctrl+1 to open the Format Cells dialog. An alternative way to do is by right-clicking the cell and then going to Format Cells > Number Tab.
- Under Category, select Custom.
- Type in the format code into the Type
- Finally, click OK to save your changes.
For detailed information about Number Formatting please see: Number Formatting in Excel – All You Need to Know