简体   繁体   English

如何让Excel通过一次搜索返回多个数据单元格

[英]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))

汽车搜索2 原始数据2

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.

相关问题 如何将多个单元格中的数据合并到Excel 2010中的一个单元格中? - How to combine data from multiple cells into one cell in Excel 2010? 当其中一个单元格必须接受超过255个字符的值时,如何从SQL Server加载Excel中的数据 - How to load data in Excel from SQL Server when one of the cells have to accept value more 255 characters 将数据从一个 RichTextBox C# 导出到多个 Excel 单元格 - Export Data to multiple Excel cells from one RichTextBox C# 如何在一个单元格中获取数据并将其移动到Excel中的多个单元格 - How to take data in one cell and move it to multiple cells in Excel 如何将来自多个excel单元的数据合并到一个列表中,然后删除重复项? - How do I join the data from multiple excel cells to make one list and then remove the duplicates? excel - 将范围内的多个单元格与来自其他单元格的文本匹配并返回特定的单元格数据 - excel - match multiple cells in a range with text from other cells and return a particular cell data 如何从一个范围中搜索多个名称并返回excel中的多条记录? - How to search multiple names from a range and return multiple records in excel? 有没有办法使用 isnumber 和 search 从多个单元格中提取并搜索多个单元格以返回多个单元格? - Is there a way to use isnumber and search to pull from multiple cells and search multiple cells to return to multiple cells? 如果 Excel 中有公式,如何添加多个单元格 - How to Add multiple Cells if they have an formula in Excel 从HTML抓取数据以返回Excel中的单元格 - Scraping data from HTML to return to cells in Excel
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM