[英]How to have Excel return multiple cells of data from one search
I have two sheets in Excel. 我在Excel中有两张纸。
The first sheet is called 'Car Search' . 第一页称为“汽车搜索” 。
The second sheet is called 'Raw Data' . 第二张纸称为“原始数据” 。 This sheet contains a 'Car ID' column for each car variant (eg VW Golf TDI has the Car ID 2612. VW Golf TSI has the Car ID 2613). 此工作表包含每种汽车型号的“汽车ID”列(例如,大众高尔夫TDI的汽车ID为2612。大众高尔夫TSI的汽车ID为2613)。
I want to search for the Car ID in the 'Car Search' sheet and would like it to return all the data about that specific car from the 'Raw Data' sheet. 我想在“汽车搜索”表中搜索汽车ID,并希望它从“原始数据”表中返回有关该特定汽车的所有数据。
I have tried using VLOOKUP but I don't know how it would be able to return data from multiple cells and columns. 我尝试使用VLOOKUP,但是我不知道它将如何从多个单元格和列中返回数据。
Please see screenshot of both sheets below. 请在下面查看两个工作表的屏幕截图。
Any help will be much appreciated! 任何帮助都感激不尽!
EDIT: 编辑:
I have one more issue: I have tried to use the same formula in the Notes field but it only picks up the values from the first 'Notes' Column in the 'Raw Data' sheet. 我还有一个问题:我尝试在“注释”字段中使用相同的公式,但它仅从“原始数据”表中的第一“注释”列中选取值。 The formula is =INDEX('Raw Data'!A:Z,MATCH($B$3,'Raw Data'!A:A,0),MATCH(E2,'Raw Data'!1:1,0))
公式为=INDEX('Raw Data'!A:Z,MATCH($B$3,'Raw Data'!A:A,0),MATCH(E2,'Raw Data'!1:1,0))
VLOOKUP is what you are looking for, but you will need to repeat the formula for each of the columns you are dragging back. VLOOKUP是您想要的,但是您需要为要拖回的每个列重复公式。
The following would be the basic formula: 以下是基本公式:
=VLOOKUP($B$3,RawData,[Column No],FALSE)
Where RawData is a named range for the second tab, You could replace it with: 其中RawData是第二个选项卡的命名范围,您可以将其替换为:
'Raw Data'!$A:$M
[Column No] would be the variable between the cells you are dragging back and would relate to the positional column on the Raw Data sheet. [Column No]将是您要拖回的单元格之间的变量,并且与Raw Data工作表上的位置列有关。 Each of the fields on the Car Search sheet would need a corresponding formula for the [Column No] in it. “汽车搜索”表上的每个字段都需要为其中的[列号]使用相应的公式。
All you would then need to do is change the value in B3 to the car ID, and the other fields would update. 然后,您需要做的就是将B3中的值更改为汽车ID,其他字段将更新。
You can use Index / Match to solve your problem. 您可以使用索引/匹配来解决您的问题。 Here is some pseudo code to your problem that you can adapt: 以下是您可以解决的一些伪代码:
=INDEX(RawData;MATCH(Car_ID;FirstColumn_RawData;0);MATCH(DataField;FirstRow_RawData;0)
The first match function is used to find the row where the data you want from CarID
resides, and the second match is used to find the column in which the data field you want to return is located. 第一个匹配函数用于查找您要从CarID
数据的行,第二个匹配函数用于查找要返回的数据字段所位于的列。
Alternatively as has been suggested in another answer, simply use VLOOKUP multiple times. 或者,如另一个答案中所建议的,只需多次使用VLOOKUP。
VLOOKUP will be solve your problem. VLOOKUP将为您解决问题。 learn and use VLOOKUP in multiple columns 在多列中学习和使用VLOOKUP
You can use Vlookup as many times as needed in a single cell: 您可以在单个单元格中根据需要多次使用Vlookup:
=VLOOKUP(A2,A3:E10,2)&" "&VLOOKUP(A2,A3:E10,3)
This will return the value matching A2 from range A3:E10 in column B, and then C, separated by a space 这将返回与B列中的A3:E10范围中的A2相匹配的值,然后返回C,并以空格分隔
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.