简体   繁体   English

Excel vlookup将工作表名称添加为列中的单元格值

[英]Excel vlookup adds sheet name as a cell value in a column

I am hopeless in Excel. 我对Excel没有希望。

I am trying to combine several workbooks into a single new workbook using vlookup. 我正在尝试使用vlookup将多个工作簿合并为一个新的工作簿。 I believe that I have been able to do this, but I would like to have a column that places the name of the worksheet or the workbook that it pulled the row from. 我相信我已经能够做到这一点,但是我想有一列放置工作表或从中提取行的工作簿的名称。

If someone could please point me to a couple of references that I can look at for this I would be very thankful. 如果有人可以给我指出几个参考资料,我将非常感谢。 I have attempted to look for a while but maybe I am not using a good search or not calling something by the right name. 我试图寻找一会儿,但也许我没有使用良好的搜索或未使用正确的名称打电话。

I may not even be using the right tool within excel to join these multiple exports into a single workbook, and if any one has any other suggestions please point me toward something else I can read. 我什至没有在excel中使用正确的工具将这些多个导出内容合并到一个工作簿中,并且如果有人有其他建议,请向我指出我可以阅读的其他内容。

Thank you in advance. 先感谢您。

You can't pull the worksheet name over with Vlookup but there is a workaround if you are able to put extra information in the original worksheets. 您无法使用Vlookup提取工作表名称,但是如果您能够在原始工作表中放入其他信息,则可以采用一种解决方法。

Add another column in the worksheets which concatenates the data you want to copy AND the name of the worksheet with a delimiter eg "@" in between them. 在工作表中添加另一列,以将要复制的数据和工作表的名称连接在一起,并在它们之间使用定界符(例如“ @”)。

You can get the name of the sheet by using: 您可以使用以下方法获取工作表的名称:

=RIGHT(CELL("filename",A1),LEN(CELL("filename",A1))-SEARCH("]",CELL("filename",A1)))

Then, when you VLookup the data, split the two pieces of data back into two columns on the target spreadsheet. 然后,当您VLookup数据时,将两段数据拆分回目标电子表格中的两列。

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

相关问题 Excel 中的 VBA - 更改列中的 VLOOKUP 公式以根据静态单元格值插入工作表名称 - VBA in Excel - Changing a VLOOKUP formula in a column to insert name of sheet based on static cell value 另一个工作表中的 Excel Vlookup 列 - Excel Vlookup Column in another Sheet 基于VLookup的Excel单元格值 - Excel Cell value based on VLookup Excel:另一个工作表中单元格值的名称工作表选项卡 - Excel: Name sheet tab from cell value in another sheet 检查其他多个工作表上是否存在excel单元格值-如果是,则返回存在于另一列中的工作表名称 - Check if an excel cell value exists on multiple other sheets - and if so return the name of the sheet it exists on in another column 在Excel VBA VLookup中为工作表名称使用变量 - Using variable for sheet name in excel VBA VLookup 创建引用另一个工作表的VLOOKUP,但工作表名称是单元格的内容 - Creating a VLOOKUP that references another sheet, but the sheet name is the content of a cell vlookup,但将返回的单元格名称不是该单元格中的值 - vlookup but the name of the cell that will return not the value in the cell 使用 Java 获取所选单元格的 Excel 工作表列名 - get Excel Sheet Column Name of a Chosen Cell using Java 根据列中的值填充其他工作表中的excel单元格值 - Populate excel cell value from a different sheet based on value in a column
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM