Excel:如果单元格1包含X或Y或Z,则单元格2应等于W [英] Excel: if cell 1 contains X or Y or Z, then cell 2 should equal W

查看:327
本文介绍了Excel:如果单元格1包含X或Y或Z,则单元格2应等于W的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从标题来看,我需要Excel根据相应的A行单元格内容自动填充B行单元格。



因此,如果单元格 A1 包含X或Y或Z,则单元格 B1 应等于W,或者如果 A1 包含G或H或J,单元格 B1 应等于W

解决方案

您可以尝试将此公式添加到B1:

  = IF(OR(A1 = X; A1 = Y; A1 = Z); W; IF(OR(A1 = G; A1 = H; A1 =J);W;))

检查A1是XY还是Z.如果是真的,它返回W,如果它是假的,它将调用另一个IF语句,检查A1是在GH还是J.如果是的话,是的,W再次,如果不是这样,它就不会放在那里。



可以通过仅使用一个IF / OR来简化它:

$($($)$ = $$$$$$ =H; A1 =J);W;)

必须根据您的本地设置将; 替换为


As from the title, I need Excel to auto-populate the B row cells based on the corresponding A row cells content.

So if cell A1 contains X or Y or Z, then cell B1 should equal W, or if A1 contains G or H or J, cell B1 should equal W.

解决方案

You can try adding this formula to B1:

=IF(OR(A1="X";A1="Y";A1="Z");"W";IF(OR(A1="G";A1="H";A1="J");"W";""))

The first part checks if A1 is either X Y or Z. If it's true, it returns "W", if it's false, it will call for another IF statement, that checks if A1 is in G H or J. If it's true, yes, "W" again, if it's not, it'll just put nothing in there.

It's possible to simplify it, by using only one IF/OR like this:

=IF(OR(A1="X";A1="Y";A1="Z";A1="G";A1="H";A1="J");"W";"")

You might have to replace ; with , depending on your local settings.

这篇关于Excel:如果单元格1包含X或Y或Z,则单元格2应等于W的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆