I am currently looking for a way to count posts.
I have 1- 50 posts so in total 50 posts.
If i split the posts in to work groups like the table below I can see if I have any overlap and subtract the number of posts work on twice to get back to my 50 total.
Even if I skip a couple of posts like below, in work group 2 I end on post 20 then work group 3 starts on 23, posts 21 and 22 havnt been works so I would like these deducted from the total, which again my spreadsheet performs great!
Now my issue starts if I overlap more groups.
Below I have group 2 starting at post 9 and finishing on 20.
Then group 4 also starting on post 9 and ending on 40.
In this case I can see clearly that posts 1 - 50 have had work done but my table stops correctly removing the duplicate work posts and is giveing me a total of 72 instead ofthe desired 50.
Does anyone have some fresh eyes to see what I am doing wrong?
I have 1- 50 posts so in total 50 posts.
If i split the posts in to work groups like the table below I can see if I have any overlap and subtract the number of posts work on twice to get back to my 50 total.
Book1 - 31-11-22.xlsx | |||||||
---|---|---|---|---|---|---|---|
A | B | C | D | E | |||
1 | On/OFF | Start | End | Total | Overlap | ||
2 | 1 | 1 | 10 | 10 | 2 | ||
3 | 1 | 9 | 20 | 12 | 0 | ||
4 | 1 | 21 | 30 | 10 | 0 | ||
5 | 1 | 31 | 40 | 10 | 0 | ||
6 | 1 | 41 | 50 | 10 | 0 | ||
7 | TOTAL | 52 | 2 | ||||
8 | Total - overlap | 50 | |||||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
E2:E6 | E2 | =IF(A2:A6=1,IF((B3:B7<=C2:C6)*(B3:B7>1),(C2:C6-B3:B7)+1,"0"),"OFF") |
D2 | D2 | =IF(A2=1,(C2-B2)+1,"") |
D3:D6 | D3 | =IF(A3:A6=1,IF((B3:B6>=B2:B5),IF((C3:C6>C2:C5),(C3:C6-B3:B6)+1,(C3:C6-B3:B6)+1),IF(B3:B6<=B2:B5,IF(C3:C6>C2:C5,(C3:C6-C2:C5)+E2:E5,FALSE))),"OFF") |
E7 | E7 | =SUM(E2,E3,E4,E5,E6) |
D7 | D7 | =SUM(D2,D3,D4,D5,D6)-G4-G3-G5-G6 |
D8 | D8 | =SUM(D7)-E7 |
Dynamic array formulas. |
Even if I skip a couple of posts like below, in work group 2 I end on post 20 then work group 3 starts on 23, posts 21 and 22 havnt been works so I would like these deducted from the total, which again my spreadsheet performs great!
Book1 - 31-11-22.xlsx | |||||||
---|---|---|---|---|---|---|---|
A | B | C | D | E | |||
1 | On/OFF | Start | End | Total | Overlap | ||
2 | 1 | 1 | 10 | 10 | 2 | ||
3 | 1 | 9 | 20 | 12 | 0 | ||
4 | 1 | 23 | 30 | 8 | 0 | ||
5 | 1 | 31 | 40 | 10 | 0 | ||
6 | 1 | 41 | 50 | 10 | 0 | ||
7 | TOTAL | 48 | 2 | ||||
8 | Total - overlap | 46 | |||||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
E2:E6 | E2 | =IF(A2:A6=1,IF((B3:B7<=C2:C6)*(B3:B7>1),(C2:C6-B3:B7)+1,"0"),"OFF") |
D2 | D2 | =IF(A2=1,(C2-B2)+1,"") |
D3:D6 | D3 | =IF(A3:A6=1,IF((B3:B6>=B2:B5),IF((C3:C6>C2:C5),(C3:C6-B3:B6)+1,(C3:C6-B3:B6)+1),IF(B3:B6<=B2:B5,IF(C3:C6>C2:C5,(C3:C6-C2:C5)+E2:E5,FALSE))),"OFF") |
E7 | E7 | =SUM(E2,E3,E4,E5,E6) |
D7 | D7 | =SUM(D2,D3,D4,D5,D6)-G4-G3-G5-G6 |
D8 | D8 | =SUM(D7)-E7 |
Dynamic array formulas. |
Now my issue starts if I overlap more groups.
Below I have group 2 starting at post 9 and finishing on 20.
Then group 4 also starting on post 9 and ending on 40.
In this case I can see clearly that posts 1 - 50 have had work done but my table stops correctly removing the duplicate work posts and is giveing me a total of 72 instead ofthe desired 50.
Book1 - 31-11-22.xlsx | |||||||
---|---|---|---|---|---|---|---|
A | B | C | D | E | |||
1 | On/OFF | Start | End | Total | Overlap | ||
2 | 1 | 1 | 10 | 10 | 2 | ||
3 | 1 | 9 | 20 | 12 | 0 | ||
4 | 1 | 21 | 30 | 10 | 22 | ||
5 | 1 | 9 | 40 | 32 | 0 | ||
6 | 1 | 41 | 50 | 10 | 0 | ||
7 | TOTAL | 96 | 24 | ||||
8 | Total - overlap | 72 | |||||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
E2:E6 | E2 | =IF(A2:A6=1,IF((B3:B7<=C2:C6)*(B3:B7>1),(C2:C6-B3:B7)+1,"0"),"OFF") |
D2 | D2 | =IF(A2=1,(C2-B2)+1,"") |
D3:D6 | D3 | =IF(A3:A6=1,IF((B3:B6>=B2:B5),IF((C3:C6>C2:C5),(C3:C6-B3:B6)+1,(C3:C6-B3:B6)+1),IF(B3:B6<=B2:B5,IF(C3:C6>C2:C5,(C3:C6-C2:C5)+E2:E5,FALSE))),"OFF") |
E7 | E7 | =SUM(E2,E3,E4,E5,E6) |
D7 | D7 | =SUM(D2,D3,D4,D5,D6)-G4-G3-G5-G6 |
D8 | D8 | =SUM(D7)-E7 |
Dynamic array formulas. |
Does anyone have some fresh eyes to see what I am doing wrong?