How many concurrent projects, by start date and end date?

BThis

New Member
Joined
Mar 15, 2016
Messages
11
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
  3. Mobile
I need to calculate the number of concurrent projects my team has managed per day using start and end dates.

I have almost ten years of projects--about 600 total--in a spreadsheet with columns for start and end dates for each project. I have them all in a single sheet, plus I copied each year's projects (by end date) to separate tabs for reporting purposes. Each project may last from a few days to occasionally two months, with most projects lasting around two weeks. If it's better to use the annual tabs, I can afford to ignore projects that run across the new year because that's never our maximum busy period in terms of concurrent projects. The relevant data looks like this:
Description Start Date End Date
ProjectA 1/6/2020 1/24/2020
ProjectB 1/12-2020 1/22/2020
ProjectC 1/19/2020 2/3/2020
ProjectD 1/26/2020 2/9/2020
ProjectE 2/2/2020 2/7/2020

The first three projects overlap, so we were working on three concurrent projects from 1/19 to1/22. I just need the number of concurrent projects, and really I need the maximum number of concurrent projects each year. Is there a way to graph it on a daily basis and see the peak days? Can anyone help?

Thanks in advance.
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Like this? But what if projects are not ended yet?
Book1
ABCDEFGH
1DescriptionStartEndDateCount
2ProjectA6/01/202024/01/20201/01/20200
3ProjectB12/01/202022/01/20202/01/20200
4ProjectC19/01/20203/02/20203/01/20200
5ProjectD26/01/20209/02/20204/01/20200
6ProjectE2/02/20207/02/20205/01/20200
76/01/20201
87/01/20201
98/01/20201
109/01/20201
1110/01/20201
1211/01/20201
1312/01/20202
1413/01/20202
1514/01/20202
1615/01/20202
1716/01/20202
1817/01/20202
1918/01/20202
2019/01/20203
2120/01/20203
2221/01/20203
2322/01/20203
2423/01/20202
2524/01/20202
2625/01/20201
2726/01/20202
2827/01/20202
2928/01/20202
3029/01/20202
3130/01/20202
3231/01/20202
331/02/20202
342/02/20203
353/02/20203
364/02/20202
375/02/20202
386/02/20202
397/02/20202
408/02/20201
419/02/20201
Sheet2
Cell Formulas
RangeFormula
H2:H41H2=COUNTIFS($B$2:$B$6,"<="&G2,$C$2:$C$6,">="&G2)
 
Upvote 0
really I need the maximum number of concurrent projects each year.
If this is your goal, see if this helps. It assumes that the raw data is on the active sheet when the code is run and creates a new sheet for the results (assumes you do not already have a sheet called 'Max Per Year')
I have assumed that all projects in the list have an end date entered.

Give it a try with a copy of your data.

VBA Code:
Sub MaxConcurrent()
  Dim d As Object
  Dim a As Variant
  Dim i As Long, StartYr As Long, EndYr As Long
  Dim j As Date
 
  Set d = CreateObject("Scripting.Dictionary")
  StartYr = Year(Application.Min(Columns("B:C")))
  EndYr = Year(Application.Max(Columns("B:C")))
  a = Range("A2", Range("C" & Rows.Count).End(xlUp)).Value
  For i = 1 To UBound(a)
    For j = a(i, 2) To a(i, 3)
      If d.exists(Format(j, "yyyy yyyy-mm-dd")) Then
        d(Format(j, "yyyy yyyy-mm-dd")) = Format(j, "yyyy yyyy-mm-dd ") & Split(d(Format(j, "yyyy yyyy-mm-dd")))(2) + 1
      Else
        d(Format(j, "yyyy yyyy-mm-dd")) = Format(j, "yyyy yyyy-mm-dd ") & 1
      End If
    Next j
  Next i
  Application.ScreenUpdating = False
  Sheets.Add(After:=ActiveSheet).Name = "Max Per Year"
  With Sheets("Max per Year").Columns("A").Resize(d.Count + 1)
    .Cells(1).Value = "Year Date Count"
    .Cells(2).Resize(d.Count) = Application.Transpose(d.items)
    .Sort Key1:=.Cells(2), Order1:=xlAscending, Header:=xlYes
    .TextToColumns DataType:=xlDelimited, Space:=True, Other:=False
    .Resize(, 3).Subtotal GroupBy:=1, Function:=xlMax, TotalList:=Array(3)
    .Resize(, 3).Columns.AutoFit
    ActiveSheet.Outline.ShowLevels RowLevels:=2
  End With
  Application.ScreenUpdating = True
End Sub


Here is my sample data. My dates are in d/m/y format and I have added a couple of earlier projects so that we span more than one year.

BThis 2020-04-18 1.xlsm
ABC
1DescriptionStartEnd
2ProjectA6/01/202024/01/2020
3ProjectB12/01/202022/01/2020
4ProjectC19/01/20203/02/2020
5ProjectD26/01/20209/02/2020
6ProjectE2/02/20207/02/2020
7ProjectF28/12/20195/01/2020
8ProjectG27/12/201929/12/2019
9
Sheet1



And my results. This shows the summary of maximum concurrent projects by year as you asked (I think :))


1587213085838.png



If you want to see the data for all dates that had at least 1 project, click the little 3 at the top left to expand the SubTotals info.
You could also use columns B:C to graph the daily projects as you mentioned. Again, only days with projects are shown.

1587213244436.png
 
Upvote 0
WOW! This is fantastic. *GraH, that's what I need, but it would be nice to graph it so I could see the peaks and know what the max is, or just calculate the maximum volume period.

Peter_SSs, that's brilliant! I will create a copy and run this on my data as soon as I get a break (and figure out again how to run VBA as I seldom have the opportunity to do so). I'm lucky to be still working, for an ecommerce company, and we're busier than ever during this lockdown. We are looking at new software that charges by how many concurrent projects we run, so we need to know!

THANK YOU BOTH! I'll report back this week on results, and proudly present it to my team.
--Barry
 
Upvote 0
WOW! This is fantastic. *GraH, that's what I need, but it would be nice to graph it so I could see the peaks and know what the max is, or just calculate the maximum volume period.
Hi Barry, select that range and press ALT+F1. With a bit of luck your default chart is a column chart.
 
Upvote 0
I will create a copy and run this on my data as soon as I get a break (and figure out again how to run VBA as I seldom have the opportunity to do so).
1. With your workbook active press Alt+F11 to bring up the vba window.
2. In the Visual Basic window use the menu to Insert|Module
3. Copy and Paste the code into the main right hand pane that opens at step 2.
4. Close the Visual Basic window.
5. Press Alt+F8 to bring up the Macro dialog
6. Select the macro & click ‘Run’
7. Your workbook will need to be saved as a macro-enabled workbook (*.xlsm)

Also, if you want the table (& graph) to show all dates, including those that have zero projects then my code could be amended to do that. Post back if you want that change.
 
Upvote 0
Peter,

I hope you can help. The sample data I provided wasn't exactly how my spreadsheet is formatted. You're using "B:C" for the date columns. In my spreadsheet, the "Start Date" is column B, with heading "Date Received" and the "End Date" is Column D headed "Due Date." How do I edit the VBA to match those columns?
 
Upvote 0
How do I edit the VBA to match those columns?
What version of Excel are you using? Please update your Account details (click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

If you are using Excel 365, do you have the UNIQUE() function?
 
Upvote 0
Thank you, Peter, I clicked "2016" for the Office version. My Work laptop is a Windows 10 ThinkPad, running Microsoft Office Professional Plus 2016. I don't have the "UNIQUE()" function.
 
Upvote 0
Thanks for updating your profile. Try this version

VBA Code:
Sub MaxConcurrent_v2()
  Dim d As Object
  Dim a As Variant
  Dim i As Long, StartYr As Long, EndYr As Long, lr As Long
  Dim j As Date
  
  Set d = CreateObject("Scripting.Dictionary")
  StartYr = Year(Application.Min(Columns("B:C")))
  EndYr = Year(Application.Max(Columns("B:C")))
  lr = Range("B" & Rows.Count).End(xlUp).Row
  a = Application.Index(Cells, Evaluate("row(2:" & lr & ")"), Array(2, 4))
  For i = 1 To UBound(a)
    For j = a(i, 1) To a(i, 2)
      If d.exists(Format(j, "yyyy yyyy-mm-dd")) Then
        d(Format(j, "yyyy yyyy-mm-dd")) = Format(j, "yyyy yyyy-mm-dd ") & Split(d(Format(j, "yyyy yyyy-mm-dd")))(2) + 1
      Else
        d(Format(j, "yyyy yyyy-mm-dd")) = Format(j, "yyyy yyyy-mm-dd ") & 1
      End If
    Next j
  Next i
  Application.ScreenUpdating = False
  Sheets.Add(After:=ActiveSheet).Name = "Max Per Year"
  With Sheets("Max per Year").Columns("A").Resize(d.Count + 1)
    .Cells(1).Value = "Year Date Count"
    .Cells(2).Resize(d.Count) = Application.Transpose(d.items)
    .Sort Key1:=.Cells(2), Order1:=xlAscending, Header:=xlYes
    .TextToColumns DataType:=xlDelimited, Space:=True, Other:=False
    .Resize(, 3).Subtotal GroupBy:=1, Function:=xlMax, TotalList:=Array(3)
    .Resize(, 3).Columns.AutoFit
    ActiveSheet.Outline.ShowLevels RowLevels:=2
  End With
  Application.ScreenUpdating = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,509
Messages
6,125,219
Members
449,215
Latest member
texmansru47

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