Counting numbered posts with formula

MiniFav

Board Regular
Joined
Mar 10, 2020
Messages
81
Office Version
  1. 365
Platform
  1. Windows
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.

Book1 - 31-11-22.xlsx
ABCDE
1On/OFFStartEndTotalOverlap
21110102
31920120
412130100
513140100
614150100
7TOTAL522
8Total - overlap50
Sheet1
Cell Formulas
RangeFormula
E2:E6E2=IF(A2:A6=1,IF((B3:B7<=C2:C6)*(B3:B7>1),(C2:C6-B3:B7)+1,"0"),"OFF")
D2D2=IF(A2=1,(C2-B2)+1,"")
D3:D6D3=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")
E7E7=SUM(E2,E3,E4,E5,E6)
D7D7=SUM(D2,D3,D4,D5,D6)-G4-G3-G5-G6
D8D8=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
ABCDE
1On/OFFStartEndTotalOverlap
21110102
31920120
41233080
513140100
614150100
7TOTAL482
8Total - overlap46
Sheet1
Cell Formulas
RangeFormula
E2:E6E2=IF(A2:A6=1,IF((B3:B7<=C2:C6)*(B3:B7>1),(C2:C6-B3:B7)+1,"0"),"OFF")
D2D2=IF(A2=1,(C2-B2)+1,"")
D3:D6D3=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")
E7E7=SUM(E2,E3,E4,E5,E6)
D7D7=SUM(D2,D3,D4,D5,D6)-G4-G3-G5-G6
D8D8=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
ABCDE
1On/OFFStartEndTotalOverlap
21110102
31920120
4121301022
51940320
614150100
7TOTAL9624
8Total - overlap72
Sheet1
Cell Formulas
RangeFormula
E2:E6E2=IF(A2:A6=1,IF((B3:B7<=C2:C6)*(B3:B7>1),(C2:C6-B3:B7)+1,"0"),"OFF")
D2D2=IF(A2=1,(C2-B2)+1,"")
D3:D6D3=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")
E7E7=SUM(E2,E3,E4,E5,E6)
D7D7=SUM(D2,D3,D4,D5,D6)-G4-G3-G5-G6
D8D8=SUM(D7)-E7
Dynamic array formulas.


Does anyone have some fresh eyes to see what I am doing wrong?
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

Forum statistics

Threads
1,215,007
Messages
6,122,670
Members
449,091
Latest member
peppernaut

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top