简体   繁体   English

Excel公式帮助(VLOOKUP)

[英]Excel Formula Help (VLOOKUP)

Okay. 好的。 I have a SKU in column B in Sheet1, and the price in column A in Sheet1. 我在Sheet1的B列中有一个SKU,在Sheet1的A列中有价格。 I also have a few thousand of these SKUs in Sheet2, column A, and their respective prices in Sheet2, column B. 我在Sheet2的A列中也有几千个SKU,在Sheet2的B列中有它们各自的价格。

I'm trying to do a VLOOKUP to look inside sheet2 for the sku and their price. 我正在尝试做一个VLOOKUP,以便在sheet2内查找SKU及其价格。 If the SKU exists, return it's new price, and if the SKU doesn't exist, return the original price from sheet1, columnA. 如果该SKU存在,则返回其新价格;如果该SKU不存在,则从sheet1的columnA返回原始价格。 And if it's a blank cell, return "DELETE". 如果是空白单元格,则返回“ DELETE”。

If anyone could tell me the formula to do this you'll be my all time hero. 如果有人能告诉我这样做的公式,您将成为我的英雄。

Try this formula: 试试这个公式:

=IF(ISBLANK(Sheet2!B1),"DELETE",IFNA(INDEX(Sheet1!A:A,MATCH(Sheet2!A1,Sheet1!B:B,0)),Sheet2!B1))

VLookup won't work, since it uses the left-most column in the table as the key, but you can use INDEX/MATCH to use an arbitrary column as the key. VLookup无法使用,因为它使用表中最左边的列作为键,但是您可以使用INDEX / MATCH将任意列用作键。

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

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