Marmaduke0703
New Member
- Joined
- Jan 25, 2021
- Messages
- 13
- Office Version
- 365
- Platform
- Windows
Hi,
I have a sheet that I need some help with please...
Each month, we need to summarise the absence information from a table similar to the below. I have a countif to total up the complete number of days but what we would like it know is how many separate instances there are for each row. Using the example below, Emp 1 and Emp 6 will need to show as 2 (currently hardcoded) as they came back into work ("W") between their two absences.
I've tried writing an if statement to compare the cell to the left (if the current day is "S" but the previous day is "W"...) but I need to account for any "R" or "H" values etc.
Any help will be greatly appreciated!
Thanks
I have a sheet that I need some help with please...
Each month, we need to summarise the absence information from a table similar to the below. I have a countif to total up the complete number of days but what we would like it know is how many separate instances there are for each row. Using the example below, Emp 1 and Emp 6 will need to show as 2 (currently hardcoded) as they came back into work ("W") between their two absences.
I've tried writing an if statement to compare the cell to the left (if the current day is "S" but the previous day is "W"...) but I need to account for any "R" or "H" values etc.
Any help will be greatly appreciated!
Thanks
Book1 (003).xlsx | |||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | |||
3 | Name | Count "S" Days | Count instances separated by work | 01/10 | 02/10 | 03/10 | 04/10 | 05/10 | 06/10 | 07/10 | 08/10 | 09/10 | 10/10 | 11/10 | 12/10 | 13/10 | 14/10 | 15/10 | 16/10 | 17/10 | 18/10 | ||
4 | Emp 1 | 4 | 2 | R | R | S | S | W | W | R | R | S | S | W | W | R | R | W | W | W | W | ||
5 | Emp 2 | 1 | 1 | R | R | H | H | H | H | R | R | W | R | R | S | W | W | W | H | H | R | ||
6 | Emp 3 | 0 | 0 | H | H | R | R | W | W | W | W | R | R | W | W | W | W | R | R | W | W | ||
7 | Emp 4 | 0 | 0 | R | W | W | W | R | R | W | W | W | W | W | R | R | W | W | W | W | R | ||
8 | Emp 5 | 8 | 1 | W | W | W | H | R | R | S | S | S | S | R | R | S | S | S | S | R | R | ||
9 | Emp 6 | 9 | 2 | S | S | S | S | R | R | W | W | W | R | R | S | S | S | S | S | R | R | ||
10 | Emp 7 | 13 | 1 | S | S | S | S | R | R | S | S | S | S | S | R | R | S | S | S | S | R | ||
11 | Emp 8 | 2 | 1 | S | R | R | S | W | W | W | R | R | W | W | W | W | R | R | W | W | W | ||
12 | Emp 9 | 0 | 0 | R | W | W | W | W | W | R | R | W | W | W | W | R | R | H | H | H | H | ||
13 | Emp 10 | 14 | 1 | S | S | S | S | S | R | R | S | S | S | S | R | R | S | S | S | S | S | ||
14 | Emp 11 | 0 | 0 | H | H | H | H | R | R | W | W | W | W | W | R | R | W | W | W | W | R | ||
15 | Emp 12 | 0 | 0 | W | W | W | W | R | R | W | W | W | W | W | R | R | W | W | W | W | W | ||
16 | Emp 13 | 2 | 1 | R | W | W | W | W | W | R | R | W | W | W | W | R | R | S | S | W | W | ||
17 | Emp 14 | 6 | 1 | W | W | R | R | S | S | S | S | R | R | S | S | W | W | R | R | W | W | ||
18 | Emp 15 | 2 | 1 | S | S | W | W | R | R | W | W | W | W | W | R | R | H | H | H | R | R | ||
19 | Emp 16 | 3 | 1 | W | W | R | R | S | S | S | W | W | R | R | W | W | W | R | R | W | W | ||
20 | Emp 17 | 12 | 1 | R | S | S | S | S | R | R | S | S | S | S | R | R | S | S | S | S | R | ||
21 | Emp 18 | 12 | 1 | S | R | R | S | S | S | S | R | R | S | S | S | S | R | R | S | S | S | ||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
B4:B21 | B4 | =COUNTIF(D4:U4,"S") |