简体   繁体   English

如果单元格等于另一个单元格中的值,则cellX

[英]If cell equals with a value in another cell then cellX

i am trying to use IF in the following arguement: 我试图在以下论点中使用IF:

I have a sheet with a list of products next to it a list with manufacturer. 我有一张工作表,上面有产品列表,旁边是制造商列表。 In each product corresponds to a certain manufacturer of the list. 在每个产品对应于某个制造商的列表中。

Now how i can tell a cell that if it found in the cell A1 on another sheet the a value from the list of products in the previous sheet to give me as a result the corresponded manufacturer. 现在,我如何告诉一个单元格,如果它在另一张表的单元格A1中找到,则它是上一张表中产品列表中的一个值,作为结果给我相应的制造商。

I tried the following as a test: 我尝试了以下作为测试:

=IF(COUNTIF(B9;data!A:A);data!B:B;"product not found")

were B9 is the cell that i put the product manually, data!A:A is the range of the sheet that i have the list of the products and data!B:B is the list with the manufucturers. B9是我手动放置产品的单元格,数据!A:A是我拥有产品和数据列表的图纸范围!B:B是制造商的列表。

The syntax i guess is ok since its working properly in excel but the thing is that i get always (product not found). 我猜语法是可以的,因为它可以在excel中正常工作,但问题是我总是得到(找不到产品)。

Could please someone help me? 可以请人帮我吗? Thanks in advance! 提前致谢!

I believe you are looking for either Vlookup (to find the corresponding manufacturer), or countif to say whether a manufacturer exists or not. 我相信您正在寻找Vlookup (以找到相应的制造商),或者在countif上寻找制造商是否存在。

First: Countif() 首先: Countif()

 =if(Countif(data!A:A, B9)=0;"Product has mfg", "Product not found")

Second: vlookup() 第二: vlookup()

=Vlookup(B9, Data!A:B, 2, false)

That vlookup will return the manufacturer, if one exists, if it doesn't then you will get an error. 如果存在,则该vlookup将返回制造商,如果不存在,则将出现错误。 It does this by looking up the b9 value in the first column of the range DATA!A:B . 它通过在范围DATA!A:B的第一列中查找b9值来实现。 When it finds the value, it returns data from the second column (because we put 2 as the third parameter). 找到值时,它从第二列返回数据(因为我们将2作为第三个参数)。

If you want to catch the error when the product doesn't have a manufacturer you can wrap the vlookup in an iferror() like: 如果你想赶上错误当产品没有制造商可以包裹vlookupiferror()如:

=IfError(Vlookup(B9, Data!A:B, 2, false), "Product not found")

暂无
暂无

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

相关问题 如果一个单元格值等于该值,则另一个单元格等于 - If a cell value equals this, another cell equals that 如果第 7 列中的一个单元格等于另一个单元格中的值,则更改为另一个单元格中的值 - If a cell in Column 7 equals the value in another cell change to the value in another cell 从另一个工作表复制等于单元格值的单元格 - Copy cell that equals cell value from another worksheet 计算单元格是否等于另一个范围内的值,并且该单元格右边的单元格等于TRUE - Count if cell is equal to a value in another range and the cell to the right of that equals TRUE Excel 的多公式到 IF 等于从另一个单元格值复制 - Multi Formula for Excel to IF Equals copy from another cell value Excel - 如果另一个单元格 IF 等于 true,则使用一个值 - Excel - use one value if another cell IF equals true Excel - 条件格式以突出显示单元格值是否等于并且另一个单元格值早于日期 - Excel - Conditional Formatting to highlight if cell value equals and another cell value is before date 如果表单元格等于变量值 - If table cell equals variable value 如何-如果单元格的值等于工作簿ANY选项卡中另一个单元格的值,则对单元格进行条件格式设置 - How to - Conditional formatting on a cell if its value equals a value of another cell in ANY tab of the Workbook 如果单元格等于某个值,则VBA使该单元格成为下一个可用单元格 - VBA if cell equals certain value make that cell next available cell
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM