简体   繁体   English

Excel公式如果B列中为x,则A列中为y,Z,K..etc

[英]Excel Formula If x in column B then y, Z, K..etc in Column A

So basically I have a spreadsheet, with a list of names in column B. For this list of names I want to assign text to add into the adjacent cell in column A. 因此,基本上我有了一个电子表格,在B列中有一个名称列表。对于这个名称列表,我想分配文本以添加到A列的相邻单元格中。

I have tried 我努力了

=IF((C:C="Name1", C:C="Name2"),"Text","")

However, this formula gives an error without any help. 但是,该公式给出了一个错误,没有任何帮助。

Can someone please solve this for me, or give me some information on how to solve it, as I need it to finish a project for work? 有人可以帮我解决这个问题,或者在我需要完成工作项目时给我一些有关如何解决它的信息吗?

You may need to refine your requirements. 您可能需要完善您的要求。 As I understand it, you need in cell C1 and copied down 据我了解,您需要在单元格C1中并向下复制

=IF(OR(B1="Tom",B1="Bill"),"Bill or Tom","")

在此处输入图片说明

Adjust ranges and names to suit your requirement. 调整范围和名称以适合您的要求。

If I have understood correctly 如果我理解正确

=if(b1="Name 1","Text","") + if(b1="Name 2","Text","")

If the text in cell B1 is equal to Name1 or Name2 then cell A1 (or where you choose to enter the formula) will be have "Text". 如果单元格B1中的文本等于Name1或Name2,则单元格A1(或您选择在其中输入公式的位置)将具有“文本”。 If B1 does not contain Name1 or Name2 then the cell will remain empty. 如果B1不包含Name1或Name2,则该单元格将保持为空。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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