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