Sangwoo Chun
Sangwoo Chun

Reputation: 43

Need help nesting multiple formulas

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

Upvotes: 0

Views: 40

Answers (2)

Sangwoo Chun
Sangwoo Chun

Reputation: 43

SOLVED: Had to use =arrayformula nested over the three functions.

Column B shows the number of new subscribers. Column C:V shows how many of the specified subscribers from ColB is retained over period of time.

enter image description here

Upvotes: 0

player0
player0

Reputation: 1

use:

=COUNTUNIQUE(IFNA(FILTER(sheet!$D:$D, sheet!$B:$B >= B$2, sheet!$B:$B < C$2, 
 REGEXMATCH(sheet!$L:$L, "Trial"), sheet!$G:$G > 0)))

enter image description here

Upvotes: 1

Related Questions