I am trying to identify a full weekend worked in excel.
I have taken the obvious steps and identified the week days as numbers 1 to 7 but my formula is not working correctly to identify a full weekend.
The logic I am working from is shown below along with my formula which wrongly identifies the cells in red as TRUE:
How would I change the formula to say "if A2 and B2 = 1 or A2 and B2 = 7 or A2 =7 and B2=1 return TRUE" - this would then identify full weekends worked I believe. I could do this myself though separate formulas but know there must be a simple way to complete this in one step - any help would be greatly appreciated.
I have taken the obvious steps and identified the week days as numbers 1 to 7 but my formula is not working correctly to identify a full weekend.
The logic I am working from is shown below along with my formula which wrongly identifies the cells in red as TRUE:
Test data.xlsx | |||||
---|---|---|---|---|---|
A | B | C | |||
1 | Weekday Start | Weekday End | Wrong Formula | ||
2 | 1 | 1 | TRUE | ||
3 | 1 | 2 | TRUE | ||
4 | 2 | 2 | FALSE | ||
5 | 7 | 7 | TRUE | ||
6 | 6 | 7 | TRUE | ||
7 | 7 | 1 | TRUE | ||
8 | 4 | 4 | FALSE | ||
Sheet10 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
C2:C8 | C2 | =IF(OR(A2:B2=1,A2:B2=7),TRUE, FALSE) |
How would I change the formula to say "if A2 and B2 = 1 or A2 and B2 = 7 or A2 =7 and B2=1 return TRUE" - this would then identify full weekends worked I believe. I could do this myself though separate formulas but know there must be a simple way to complete this in one step - any help would be greatly appreciated.