Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
407 views
in Technique[技术] by (71.8m points)

google sheets - 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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...