简体   繁体   中英

Nested if and countif in google sheets

I am trying to use the following formula:

=if(A16="1",(COUNTIF('responses':AF,AG,B16))>0,"Yes",if(A16="2":(COUNTIF('responses 1',AF,AG,B16)))>0:"Yes",COUNTIF(' responses',D,E,B16)>0,"Yes","No")

Basically I'm getting a message back saying there are too many arguments. This is the first time I have tried to use if nested if and countif functions and I'm really struggling. Any help greatly appreciated.

try:

=IF(A16="1", 
 IF(COUNTIF('responses'!AF:AG, B16)>0, "Yes",
 IF(A16="2", 
 IF(COUNTIF('responses 1'!AF:AG, B16)>0, "Yes", 
 IF(COUNTIF(' responses'!D:E, B16)>0, "Yes", "No")

would this work?

=if(A16="1",COUNTIF('responses'!AF:AG,B16))>0,"Yes", "No", (if(A16="2",(COUNTIF('responses 1'!AF:AG,B16)))>0,"Yes", "No"),COUNTIF(' responses'!D:E,B16)>0,"Yes","No"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM