I have three functions that will return the answer that I'm looking for but I don't want to have these functions separate because the sheet would get too cluttered. That said, I'm having difficulties nesting these formulas so that it returns only the final output. The formulas are listed below:
=UNIQUE(FILTER('Sheet'!$D:$D, 'Sheet'!$B:$B >= B$2,'Sheet'!$B:$B<C$2,regexmatch('Sheet'!$L:$L,"Trial")))
This function returns all unique ID's that meet the conditions stated.
=COUNTIFS('Sheet'!$B:$B,">="&C$2,'Sheet'!$B:$B,"<"&D$2,'Sheet'!$G:$G,">0",'Sheet'!$D:$D,B27)>0
This function returns T/F if the identified unique ID from first function exists next month. Returns 'True' if ID exists, 'False" if it does not. Cell B27 refers to the first cell row from the first function.
=COUNTIF(C27:C45,TRUE)
This function counts all True for each month. Range (C27:C45) references the output from the second function
I tried
=COUNTIF(countifs('Sheet'!$B:$B,">="&C$2,'Sheet'!$B:$B,"<"&D$2,'Sheet'!$G:$G,">0",'Sheet'!$D:$D,UNIQUE(FILTER('Sheet'!$D:$D, 'Sheet'!$B:$B >= B$2,'Sheet'!$B:$B<C$2,regexmatch('Sheet'!$L:$L,"Trial"))))>0,TRUE)
but this function returns the incorrect answer.
Any ideas? Here's the sheet: https://docs.google.com/spreadsheets/d/1l2dXCEE0enTRBzBZEwjN1Fj9-ovPjsi75WvTdgK7_Zg/edit?usp=sharing
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…