Want2BExcel
Board Regular
- Joined
- Nov 24, 2021
- Messages
- 114
- Office Version
- 2016
- Platform
- Windows
I want to count the hours from Saturday 14:00 to Mondag 06:00 and return value in decimal hours. But should ignore ALL if [Tidsart1] column E's value is "volunteer" (this last part I haven't included in any formula yet.
I'm trying to simplify the formula in the TEST (AK) column or combine thoose I've got (when errors is corrected). Right now it's a bunch of different formulas. Some are working, some has errors (Marked with red in the table)
There's 3x2 time colums. C+D (start1-stop1), F+G (start2-stop2), I+J (start3-stop3). There isn't always has data in all 3. If C+D don't, then the rest will not either, in that case, the result should alwasy be 0
[Tuesdag to Friday]=AK29:AK32,AK22:AK25,AK15:AK18,AK8:AK11,AK2:AK4 - This formula is working
[Monday]=AK7,AK28,AK21,AK14 - This formula seems to work somewhat ok if the result is positive, but I want it to return a value of 0 if the result is negative
[Saturday]=AK5,AK26,AK19,AK12 - This formula's result confuse me. In AK5 it looks to be working fine, only counting the hours from 14:00-15:00, but in AK12 it is not working, since it's counting all hours from F+G (12:45-15:00), I+J (19:00-00:00), but correctly ignores C+D (00:00-01:00). So it looks like I have an issue when there's data in other time columns than C+D
[Sunday]=AK6,AK27,AK20,AK13 - This formula is working, but seems a bit comprehensive when all hours should be counted
I'm trying to simplify the formula in the TEST (AK) column or combine thoose I've got (when errors is corrected). Right now it's a bunch of different formulas. Some are working, some has errors (Marked with red in the table)
There's 3x2 time colums. C+D (start1-stop1), F+G (start2-stop2), I+J (start3-stop3). There isn't always has data in all 3. If C+D don't, then the rest will not either, in that case, the result should alwasy be 0
[Tuesdag to Friday]=AK29:AK32,AK22:AK25,AK15:AK18,AK8:AK11,AK2:AK4 - This formula is working
[Monday]=AK7,AK28,AK21,AK14 - This formula seems to work somewhat ok if the result is positive, but I want it to return a value of 0 if the result is negative
[Saturday]=AK5,AK26,AK19,AK12 - This formula's result confuse me. In AK5 it looks to be working fine, only counting the hours from 14:00-15:00, but in AK12 it is not working, since it's counting all hours from F+G (12:45-15:00), I+J (19:00-00:00), but correctly ignores C+D (00:00-01:00). So it looks like I have an issue when there's data in other time columns than C+D
[Sunday]=AK6,AK27,AK20,AK13 - This formula is working, but seems a bit comprehensive when all hours should be counted
Arb.tid & Friheder TEST.xlsx | |||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | AK | ||||||||||||||||||||||||||||
1 | Ugedag | Dato | Start1 | Slut1 | Tidsart1 | Start2 | Slut2 | Tidsart2 | Start3 | Slut3 | Tidsart3 | TEST | |||||||||||||||||||||||||||
2 | Onsdag | 01-12-21 | 07:30 | 15:30 | FTG | 0 | |||||||||||||||||||||||||||||||||
3 | Torsdag | 02-12-21 | 07:30 | 14:30 | FTG | 0 | |||||||||||||||||||||||||||||||||
4 | Fredag | 03-12-21 | 07:30 | 13:30 | FTG | 0 | |||||||||||||||||||||||||||||||||
5 | Lørdag | 04-12-21 | 12:45 | 15:00 | T | 1 | |||||||||||||||||||||||||||||||||
6 | Søndag | 05-12-21 | 00:00 | 01:00 | T | 12:45 | 15:00 | T | 19:00 | 00:00 | T | 8,25 | |||||||||||||||||||||||||||
7 | Mandag | 06-12-21 | 06:45 | 08:30 | R | -0,75 | |||||||||||||||||||||||||||||||||
8 | Tirsdag | 07-12-21 | 00:00 | 01:00 | T | 14:45 | 00:00 | T | 0 | ||||||||||||||||||||||||||||||
9 | Onsdag | 08-12-21 | 00:00 | 01:00 | T | 14:45 | 00:00 | T | 0 | ||||||||||||||||||||||||||||||
10 | Torsdag | 09-12-21 | 00:00 | 01:00 | T | 12:45 | 00:00 | T | 0 | ||||||||||||||||||||||||||||||
11 | Fredag | 10-12-21 | 00:00 | 01:00 | T | 14:45 | 00:00 | T | 0 | ||||||||||||||||||||||||||||||
12 | Lørdag | 11-12-21 | 00:00 | 01:00 | T | 12:45 | 15:00 | T | 19:00 | 00:00 | T | 7,25 | |||||||||||||||||||||||||||
13 | Søndag | 12-12-21 | 17:45 | 20:15 | R | 2,5 | |||||||||||||||||||||||||||||||||
14 | Mandag | 13-12-21 | 00:00 | 08:30 | R | 6 | |||||||||||||||||||||||||||||||||
15 | Tirsdag | 14-12-21 | 07:30 | 15:30 | FTG | 0 | |||||||||||||||||||||||||||||||||
16 | Onsdag | 15-12-21 | 07:30 | 15:30 | FTG | 0 | |||||||||||||||||||||||||||||||||
17 | Torsdag | 16-12-21 | 07:30 | 14:30 | FTG | 0 | |||||||||||||||||||||||||||||||||
18 | Fredag | 17-12-21 | 07:30 | 13:30 | §17 | 0 | |||||||||||||||||||||||||||||||||
19 | Lørdag | 18-12-21 | 0 | ||||||||||||||||||||||||||||||||||||
20 | Søndag | 19-12-21 | 0 | ||||||||||||||||||||||||||||||||||||
21 | Mandag | 20-12-21 | 08:00 | 17:00 | T | -2 | |||||||||||||||||||||||||||||||||
22 | Tirsdag | 21-12-21 | 07:30 | 15:30 | T | 0 | |||||||||||||||||||||||||||||||||
23 | Onsdag | 22-12-21 | 07:30 | 15:30 | T | 0 | |||||||||||||||||||||||||||||||||
24 | Torsdag | 23-12-21 | 07:30 | 14:30 | T | 0 | |||||||||||||||||||||||||||||||||
25 | Fredag | 24-12-21 | 07:30 | 13:30 | T | 0 | |||||||||||||||||||||||||||||||||
26 | Lørdag | 25-12-21 | 07:30 | 15:30 | volunteer | 1,5 | |||||||||||||||||||||||||||||||||
27 | Søndag | 26-12-21 | 07:30 | 15:30 | volunteer | 8 | |||||||||||||||||||||||||||||||||
28 | Mandag | 27-12-21 | 05:30 | 15:30 | volunteer | 0,5 | |||||||||||||||||||||||||||||||||
29 | Tirsdag | 28-12-21 | 07:30 | 15:30 | T | 0 | |||||||||||||||||||||||||||||||||
30 | Onsdag | 29-12-21 | 07:30 | 15:30 | T | 0 | |||||||||||||||||||||||||||||||||
31 | Torsdag | 30-12-21 | 07:30 | 14:30 | T | 0 | |||||||||||||||||||||||||||||||||
32 | Fredag | 31-12-21 | 07:30 | 13:30 | T | 0 | |||||||||||||||||||||||||||||||||
Dec.21 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
AK29:AK32,AK22:AK25,AK15:AK18,AK8:AK11,AK2:AK4 | AK2 | =(IF(OR([@Ugedag]="Tirsdag",[@Ugedag]="Onsdag",[@Ugedag]="Torsdag",[@Ugedag]="Fredag",0),0)) |
AK5,AK26,AK19,AK12 | AK5 | =24*((IF(OR([@Ugedag]="Lørdag",[@Start1]<TIME(14,0,0),[@Start1]="",[@Slut1]=""),0,MAX(MIN((IF([@Slut1]<[@Start1],1,[@Slut1])),TIME(14,0,0))-MAX([@Start1],0,0))))+(IF(OR(AND([@Slut1]<TIME(14,0,0),[@Slut1]<>0),[@Start1]="",[@Slut1]=""),0,MAX(MIN((IF([@Slut1]<[@Start1],1,[@Slut1])),1)-MAX([@Start1],TIME(14,0,0),0))))+(IF(OR([@Start2]>TIME(14,0,0),[@Start2]="",[@Slut2]=""),0,MAX(MIN((IF([@Slut2]<[@Start2],1,[@Slut2])),TIME(14,0,0))-MAX([@Start2],0,0))))+(IF(OR(AND([@Slut2]<TIME(14,0,0),[@Slut2]<>0),[@Start2]="",[@Slut2]=""),0,MAX(MIN((IF([@Slut2]<[@Start2],1,[@Slut2])),1)-MAX([@Start2],TIME(14,0,0),0))))+(IF(OR([@Start3]>TIME(14,0,0),[@Start3]="",[@Slut3]=""),0,MAX(MIN((IF([@Slut3]<[@Start3],1,[@Slut3])),TIME(14,0,0))-MAX([@Start3],0,0))))+(IF(OR(AND([@Slut3]<TIME(14,0,0),[@Slut3]<>0),[@Start3]="",[@Slut3]=""),0,MAX(MIN((IF([@Slut3]<[@Start3],1,[@Slut3])),1)-MAX([@Start3],TIME(14,0,0),0))))) |
AK6,AK27,AK20,AK13 | AK6 | =24*((IF(OR([@Ugedag]="Søndag",[@Start1]<TIME(0,0,0),[@Start1]="",[@Slut1]=""),0,MAX(MIN((IF([@Slut1]<[@Start1],1,[@Slut1])),TIME(0,0,0))-MAX([@Start1],0,0))))+(IF(OR(AND([@Slut1]<TIME(0,0,0),[@Slut1]<>0),[@Start1]="",[@Slut1]=""),0,MAX(MIN((IF([@Slut1]<[@Start1],1,[@Slut1])),1)-MAX([@Start1],TIME(0,0,0),0))))+(IF(OR([@Start2]>TIME(0,0,0),[@Start2]="",[@Slut2]=""),0,MAX(MIN((IF([@Slut2]<[@Start2],1,[@Slut2])),TIME(0,0,0))-MAX([@Start2],0,0))))+(IF(OR(AND([@Slut2]<TIME(0,0,0),[@Slut2]<>0),[@Start2]="",[@Slut2]=""),0,MAX(MIN((IF([@Slut2]<[@Start2],1,[@Slut2])),1)-MAX([@Start2],TIME(0,0,0),0))))+(IF(OR([@Start3]>TIME(0,0,0),[@Start3]="",[@Slut3]=""),0,MAX(MIN((IF([@Slut3]<[@Start3],1,[@Slut3])),TIME(0,0,0))-MAX([@Start3],0,0))))+(IF(OR(AND([@Slut3]<TIME(0,0,0),[@Slut3]<>0),[@Start3]="",[@Slut3]=""),0,MAX(MIN((IF([@Slut3]<[@Start3],1,[@Slut3])),1)-MAX([@Start3],TIME(0,0,0),0))))) |
AK7,AK28,AK21,AK14 | AK7 | =24*((IF(OR([@Ugedag]="Mandag",[@Start1]>TIME(0,0,0),[@Start1]="",[@Slut1]=""),MAX(MIN((IF([@Slut1]<[@Start1],1,[@Slut1])),TIME(6,0,0))-MAX([@Start1],0,0)),0))+(IF(OR([@Start2]>TIME(0,0,0),[@Start2]="",[@Slut2]=""),0,MAX(MIN((IF([@Slut2]<[@Start2],1,[@Slut2])),TIME(0,0,0))-MAX([@Start2],6,0),0))+IF(OR([@Start3]>TIME(0,0,0),[@Start3]="",[@Slut3]=""),0,MAX(MIN((IF([@Slut3]<[@Start3],1,[@Slut3])),TIME(0,0,0))-MAX([@Start3],6,0),0)))) |