我认为我已经犯了一个错误,因为它一直在返回#VALUE
。
IF(AND(G2="green",G3="green"),"GG"), IF(AND(G2="red",G3="red"),"RR"),
IF(AND(G2="red",G3="green"),"RG"), IF(AND(G2="green",G3="red"),"GR")
我试图说它是红色还是绿色,打印RG和其他如RR,GR,GG。
答案 0 :(得分:2)
IF()
函数有三个参数:Test
,Then-value
,Otherwise-value
。所以函数应该是这样的:
=IF(AND(G2="green",G3="green"),
"GG",IF(AND(G2="red",G3="red"),
"RR",IF(AND(G2="red",G3="green"),
"RG",IF(AND(G2="green",G3="red"),
"GR"))))
答案 1 :(得分:1)
试一试,
=IF(SUM(COUNTIF(G2:G3,{"red","green"}))=2,UPPER(LEFT(G2)&LEFT(G3)), TEXT(,))