简体   繁体   中英

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. For example:

Sheet1:

Lvl Amount ID
1A $ 001
2B $ 002
2C $ 003
1B $ 001

Sheet2:

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. The completed would be:

Sheet1 (completed):

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. Also, I can't use VBA as it is blocked by my company.

Any help would be appreciated!

Using SUMIFS and INDEX/MATCH :

=SUMIFS(INDEX(Sheet2!B:D,,MATCH(C2,Sheet2!$B$1:$D$1,0)),Sheet2!A:A,A2)

Sheet1:

在此处输入图像描述

Sheet2:

在此处输入图像描述

I would use HLOOKUP and 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. HLOOKUP needs the row index to look in, and it will use the ID number as C2 to find that in the table columns.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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