[英]How would I copy a cell based on multiple cell values
Morning all, I have a question I'm hoping someone can help me with a formula for.大家早上好,我有一个问题,我希望有人能帮我找到一个公式。 I'm trying to return a value from Sheet2 into Sheet1 based on two different criteria.
我正在尝试根据两个不同的标准将 Sheet2 中的值返回到 Sheet1 中。 For example:
例如:
Sheet1:表 1:
Lvl![]() |
Amount![]() |
ID ![]() |
---|---|---|
1A ![]() |
$ ![]() |
001 ![]() |
2B ![]() |
$ ![]() |
002 ![]() |
2C ![]() |
$ ![]() |
003 ![]() |
1B ![]() |
$ ![]() |
001 ![]() |
Sheet2:表2:
Lvl![]() |
001 ![]() |
002 ![]() |
003 ![]() |
---|---|---|---|
1A ![]() |
$300 ![]() |
$275 ![]() |
$250 ![]() |
1B ![]() |
$200 ![]() |
$175 ![]() |
$150 ![]() |
1C ![]() |
$100 ![]() |
$75 ![]() |
$50 ![]() |
2A ![]() |
$350 ![]() |
$325 ![]() |
$315 ![]() |
2B ![]() |
$250 ![]() |
$225 ![]() |
$210 ![]() |
2C ![]() |
$150 ![]() |
$125 ![]() |
$110 ![]() |
So on Sheet1, if the first column value matches the Sheet2 first column value, then return the value in that row for the correct ID.所以在 Sheet1 上,如果第一列值与 Sheet2 第一列值匹配,则返回该行中的值以获得正确的 ID。 The completed would be:
完成的将是:
Sheet1 (completed):表 1(已完成):
Lvl![]() |
Amount![]() |
ID ![]() |
---|---|---|
1A ![]() |
$300 ![]() |
001 ![]() |
2B ![]() |
$225 ![]() |
002 ![]() |
2C ![]() |
$110 ![]() |
003 ![]() |
1B ![]() |
$200 ![]() |
001 ![]() |
I'm stumped on how to do a multiple lookup like this though and on what formula would go in Sheet1 in the Amount column.我很困惑如何进行这样的多重查找,以及金额列中 Sheet1 中的 go 的公式。 Also, I can't use VBA as it is blocked by my company.
另外,我不能使用 VBA,因为它被我的公司阻止了。
Any help would be appreciated!任何帮助,将不胜感激!
I would use HLOOKUP
and MATCH
.我会使用
HLOOKUP
和MATCH
。
=HLOOKUP(C2,Sheet2:A$1,D$7,MATCH(A2:Sheet2,A$1:A$7,0))
MATCH
will return the row index of the Lvl that you are looking for. MATCH
将返回您正在寻找的 Lvl 的行索引。 HLOOKUP
needs the row index to look in, and it will use the ID number as C2 to find that in the table columns. HLOOKUP
需要行索引来查找,它会使用 ID 号作为 C2 在表列中查找。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.