如果细胞是空白的,该怎么办?

时间:2017-06-02 18:45:48

标签: excel

我在excel中有一行代码,并且想要添加一个函数,如果引用单元格为空,则只返回空。我怎么能添加到那个?提前谢谢!

此处我的代码到目前为止:

=IF(
 ISNA(VLOOKUP($A2,'[DataSheet.xlsx]SOC 41'!$C$2:$P$5000,1,FALSE))=TRUE,"","R41: " & VLOOKUP($A2,'[DataSheet.xlsx]SOC 41'!$C$2:$P$5000,10,FALSE))&"
 "&IF(ISNA(VLOOKUP($A2,'[DataSheet.xlsx]SOC 42'!$C$2:$P$5000,1,FALSE))=TRUE,"","R42: " & VLOOKUP($A2,'[DataSheet.xlsx]SOC 42'!$C$2:$P$5000,10,FALSE))&"
 "&IF(ISNA(VLOOKUP($A2,'[DataSheet.xlsx]SOC 43'!$C$2:$P$5000,1,FALSE))=TRUE,"","R43: " & VLOOKUP($A2,'[DataSheet.xlsx]SOC 43'!$C$2:$P$5000,10,FALSE))

同样,如果返回单元格有空字符串,如何将ISBLANK(或其他内容)添加到代码中该怎么办?

即使我尝试了这个并且没有工作。

=IF(OR(
VLOOKUP($A11,'[DataSheet]SOC 41'!$C$2:$P$5000,11,FALSE)="",
VLOOKUP($A11,'[DataSheet]SOC 42'!$C$2:$P$5000,11,FALSE)="",
VLOOKUP($A11,'[DataSheet]SOC 43'!$C$2:$P$5000,11,FALSE)=""),"",
IF(
ISNA(VLOOKUP($A11,'[DataSheet]SOC 41'!$C$2:$P$5000,1,FALSE))=TRUE,"","R41: " & VLOOKUP($A11,'[DataSheet]SOC 41'!$C$2:$P$5000,11,FALSE))&"
"&IF(ISNA(VLOOKUP($A11,'[DataSheet]SOC 42'!$C$2:$P$5000,1,FALSE))=TRUE,"","R42: " & VLOOKUP($A11,'[DataSheet]SOC 42'!$C$2:$P$5000,11,FALSE))&"
"&IF(ISNA(VLOOKUP($A11,'[DataSheet]SOC 43'!$C$2:$P$5000,1,FALSE))=TRUE,"","R43: " & VLOOKUP($A11,'[DataSheet]SOC 43'!$C$2:$P$5000,11,FALSE)))

请帮忙!

1 个答案:

答案 0 :(得分:0)

将公式嵌套在:

=if(A2<>"",formula,"")