EXCEL能不能帮我解释一下下面的函数?
=IF(B2="","",IF(OR(B2={"香蕉","苹果","梨"}),IF(C2<>"",D2*10,IF(C2="",D2*VLOOKUP(B2,{"香蕉",2...
=IF(B2="","",IF(OR(B2={"香蕉","苹果","梨"}),IF(C2<>"",D2*10,IF(C2="",D2*VLOOKUP(B2,{"香蕉",20;"苹果",30;"梨",40},2,)))))
展开
3个回答
展开全部
对于这个公式的解释:
如果B2为空,则为空;
如果B2为"香蕉" "苹果" "梨"中任一值,则:
1.若C2不为空,则显示为: D2*10,
2.若C2为空,则B2为香焦,值为D2*20
B2为苹果,值为D2*30
B2为梨时,值为D2*40
这个公式只有写在自E列及以后各列的第二行单元格中才是有效的,且有普遍意义.
=IF(B2="","",IF(OR(B2={"香蕉","苹果","梨"}),IF(OR(C2=0,C2=""),D2*100,D2*VLOOKUP(B2,{"香蕉",20;"苹果",30;"梨",40},2,))))
对于上面公式,若要实现:当C2为0值或空值时,D2乘20;30;40。当C2不为0值或空值时,D2*100的功能,可做以下更改:
=IF(C2="","",IF(OR(B2={"香蕉","苹果","梨"}),IF(OR(C2=0,C2=""),D2*VLOOKUP(B2,{"香蕉",20;"苹果",30;"梨",40},2,),D2*100)))
如果B2为空,则为空;
如果B2为"香蕉" "苹果" "梨"中任一值,则:
1.若C2不为空,则显示为: D2*10,
2.若C2为空,则B2为香焦,值为D2*20
B2为苹果,值为D2*30
B2为梨时,值为D2*40
这个公式只有写在自E列及以后各列的第二行单元格中才是有效的,且有普遍意义.
=IF(B2="","",IF(OR(B2={"香蕉","苹果","梨"}),IF(OR(C2=0,C2=""),D2*100,D2*VLOOKUP(B2,{"香蕉",20;"苹果",30;"梨",40},2,))))
对于上面公式,若要实现:当C2为0值或空值时,D2乘20;30;40。当C2不为0值或空值时,D2*100的功能,可做以下更改:
=IF(C2="","",IF(OR(B2={"香蕉","苹果","梨"}),IF(OR(C2=0,C2=""),D2*VLOOKUP(B2,{"香蕉",20;"苹果",30;"梨",40},2,),D2*100)))
展开全部
如果B2为空,则为空;
如果B2为"香蕉" "苹果" "梨"中任一值,则:
1.若C2不为空,则显示为: D2*10,
2.若C2为空,则B2为香焦,值为D2*20
B2为苹果,值为D2*30
B2为梨时,值为D2*40
若B2值均不是"香蕉" "苹果" "梨"中任一值,则值为2
如果B2为"香蕉" "苹果" "梨"中任一值,则:
1.若C2不为空,则显示为: D2*10,
2.若C2为空,则B2为香焦,值为D2*20
B2为苹果,值为D2*30
B2为梨时,值为D2*40
若B2值均不是"香蕉" "苹果" "梨"中任一值,则值为2
更多追问追答
追问
IF(B2="","",IF(OR(B2={"香蕉","苹果","梨"}),IF(OR(C2=0,C2=""),D2*100,D2*VLOOKUP(B2,{"香蕉",20;"苹果",30;"梨",40},2,))))
怎样把上面公式改成当:当C2为0值或空值时,D2乘20;30;40。当C2不为0值或空值时,D2*100
追答
IF(B2="","",IF(OR(B2={"香蕉","苹果","梨"}),IF(OR(C2=0,C2=""),D2*VLOOKUP(B2,{"香蕉",20;"苹果",30;"梨",40},D2*100))))
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
=IF(B2="","",IF(OR(B2={"香蕉","苹果","梨"}),IF(C2=0,D2*VLOOKUP(B2,{"香蕉",20;"苹果",30;"梨",40},2,),D2*100)))
或
=IF(B2="","",IF(OR(B2={"香蕉","苹果","梨"}),IF(C2=0,D2*100,D2*VLOOKUP(B2,{"香蕉",20;"苹果",30;"梨",40},2,))))
你图中的公式,在VLOOKUP函数的后半段,漏了 ,2,)
或
=IF(B2="","",IF(OR(B2={"香蕉","苹果","梨"}),IF(C2=0,D2*100,D2*VLOOKUP(B2,{"香蕉",20;"苹果",30;"梨",40},2,))))
你图中的公式,在VLOOKUP函数的后半段,漏了 ,2,)
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询