简体   繁体   English

Excel 查找值跨行和列

[英]Excel Lookup value spans across rows and columns

I have some data in one sheet 1 that has the Pupil Name and some other pupil related data.我在一张表 1 中有一些数据,其中包含学生姓名和其他一些与学生相关的数据。

For example:例如:

Pupil Name
Joe Bloggs
Terry Jones
Peter Smith
John Doe
Lenny Peter
Harry Potter

In another sheet (sheet 2) a list of teachers and the corresponding pupils they will be conducting the interview with.在另一张表格(表格 2)中,列出了教师和他们将与之进行面试的相应学生。 Each teacher will have upto 6 interviews and these are in columns Candidate 1 to Candidate 6.每位教师最多将有 6 次面试,这些面试在候选人 1 到候选人 6 列中。

For example例如

Teacher, Candidate 1, Candidate 2, Candidate 3, Candidate 4, Candidate 5, Candidate 6
Mrs Smith, Joe Bloggs, Terry Jones, Peter Smith, John Doe, Lenny Peter, Harry Potter

In sheet 1, I would like to bring back the name of the interviewer back into the pupil sheet.在表 1 中,我想将面试官的姓名带回学生表。 I've tried INDEX and Match by even adding the column headers in the column match but this only brings back those interviewers in the Candidate 1 column and not the other 5 columns.我什至通过在列匹配中添加列标题来尝试使用 INDEX 和 Match,但这只会带回 Candidate 1 列中的那些面试官,而不是其他 5 列。 Is there a way to do this?有没有办法做到这一点?

Thanks,谢谢,

You'd need something like the following in B2 :您需要在B2包含以下内容:

=INDEX(Sheet2!A$2:A$100,SUMPRODUCT((Sheet2!B$2:G$100=A2)*(ROW(B$2:G$100)))-1)

Obivously the 100 needs to be swapped with a rownumber that your data on Sheet2 ends.显然100需要与您在Sheet2上的数据结束的行号交换。

You can use HLOOKUP.您可以使用 HLOOKUP。

Here is my take on the issue Example worksheet这是我对这个问题的看法示例工作表

I used the following formula in the second column =+HLOOKUP(A2;$E$2:$K$3;2;0)我在第二列中使用了以下公式 =+HLOOKUP(A2;$E$2:$K$3;2;0)

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

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