ExcelNewbie2020
Active Member
- Joined
- Dec 3, 2020
- Messages
- 343
- Office Version
- 365
- Platform
- Windows
how to count a criteria if its not alligned with criteria range. Please see below table. need to count the hours between 2 dates (from/to). however, dates are not alligned with the hours.
Book2 | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | |||
1 | EXPECTED RESULT | ||||||||||||||||
2 | FROM | TO | |||||||||||||||
3 | Name | 11-08-23 | 14-08-23 | 11-08-23 | 12-08-23 | 13-08-23 | 14-08-23 | ||||||||||
4 | Count of 12 hrs | Count of 8hrs | Department | Shift | HOURS | Department | Shift | HOURS | Department | Shift | HOURS | Department | Shift | HOURS | |||
5 | name1 | 0 | 4 | ABC | shift 1 | 8 | ABC | shift 1 | 8 | ABC | shift 1 | 8 | ABC | shift 1 | 8 | ||
6 | name2 | 0 | 4 | DEF | shift 2 | 8 | DEF | shift 2 | 8 | DEF | shift 2 | 8 | DEF | shift 2 | 8 | ||
7 | name3 | 4 | 0 | ABC | shift 3 | 12 | ABC | shift 3 | 12 | ABC | shift 3 | 12 | ABC | shift 3 | 12 | ||
8 | name4 | 0 | 0 | DEF | shift 1 | 0 | DEF | shift 1 | 0 | DEF | shift 1 | 0 | DEF | shift 1 | 0 | ||
9 | name5 | 0 | 4 | ABC | shift 2 | 8 | ABC | shift 2 | 8 | ABC | shift 2 | 8 | ABC | shift 2 | 8 | ||
10 | name6 | 4 | 0 | DEF | shift 3 | 12 | DEF | shift 3 | 12 | DEF | shift 3 | 12 | DEF | shift 3 | 12 | ||
11 | name7 | 0 | 4 | ABC | shift 1 | 8 | ABC | shift 1 | 8 | ABC | shift 1 | 8 | ABC | shift 1 | 8 | ||
12 | name8 | 0 | 4 | DEF | shift 2 | 8 | DEF | shift 2 | 8 | DEF | shift 2 | 8 | DEF | shift 2 | 8 | ||
13 | name9 | 0 | 4 | ABC | shift 3 | 8 | ABC | shift 3 | 8 | ABC | shift 3 | 8 | ABC | shift 3 | 8 | ||
14 | name10 | 4 | 0 | DEF | shift 1 | 12 | DEF | shift 1 | 12 | DEF | shift 1 | 12 | DEF | shift 1 | 12 | ||
15 | name11 | 4 | 0 | ABC | shift 2 | 12 | ABC | shift 2 | 12 | ABC | shift 2 | 12 | ABC | shift 2 | 12 | ||
16 | name12 | 0 | 4 | DEF | shift 3 | 8 | DEF | shift 3 | 8 | DEF | shift 3 | 8 | DEF | shift 3 | 8 | ||
17 | name13 | 0 | 0 | EFG | OFF | 0 | EFG | OFF | 0 | EFG | OFF | 0 | EFG | OFF | 0 | ||
Sheet1 |