Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
596 views
in Technique[技术] by (71.8m points)

indexing - Excel Index Match Multiple Criteria

I have to write an Index & Match excel formula, containing multiple criteria!

I have 2 tables: Table

My formula should have the following structure: if Mercedes exists in the first column and Mercedes exists in the fifth column and if the code in the second column matches the code in the sixth column then take the cost from the seventh column and put it in the fourth empty column: enter image description here

If both conditions not met, then insert 0. FORD  15 0

It worked when I used Index & Match with 1 criterion, as seen in the above table:

=(INDEX($G$2:$G$4,MATCH(E2,$A$2:$A$6,0),0))

G is cost column, E2 is value in the second brand column and A is, of course, the first brand column. To add multiple criteria I have tried:

=INDEX(G2:G6,MATCH(1,(A2=A2:A4)*(E2=E2:E4),0))

It does not work! (returns N/A)

Could you please tell me where I am wrong?

Thank you!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Try matching with a combined formula: (assumes E and F are match terms and A and B are the array to match within, with C providing output)

{=Index(C:C,Match(E1&F1,A:A&B:B,0))}

Use Ctrl+Shift+Enter to utilize the array

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...