Why it works
- What it does
- WEEKDAY gives the day of the week as a number. On its own it counts Sunday as 1 and Saturday as 7, so the weekend sits at both ends. With 2 as the second part, Monday is 1 and Sunday 7, and the weekend is anything above 5.
- The shape of the formula
- =IF(WEEKDAY(date, 2) > 5, weekend value, weekday value)
- How to remember it
- WEEKDAY(date,2)>5 is the weekend, in one test.
- The usual mistake
- Testing WEEKDAY(B2)=7 for the weekend. That catches Saturday only, and Sunday shifts are paid as weekdays.
Keep practicing
- IF: one result or anotherHow do I mark items that need reordering?Open
- NETWORKDAYS: working days between two dates, holidays outHow do I count working days between two dates without weekends and holidays?Open
- Absolute references: lock a cell with $How do I multiply every row by the same rate cell?Open
Updated