简体   繁体   中英

Excel - Match cell values in 2 separate columns and paste a different value if match

=INDEX(C:C,MATCH(A1,B:B,0))

The above formula is being pasted in D1 .

I need it to return the C cell that on the same row as the matching A and B fields:

A       B        C            D

77      22       MO91117
88      88       MO91337
99      99       MO12347
22      77       MO91837

Ideally, if I ran the formula in D1 , it would return M091837 .

Any help would be greatly appreciated!

Answering for completeness. Credit to ASH for the answer (in the comments of the question).

Ensure that both columns that you are trying to match are formatted similarly. It looks like the error in this question was that one column was formatted as text, and one column was formatted as a number. As an example the number 4 and the character 4 are represented differently in software, thus not returning expected values when trying to match text and numbers.

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