英文:
VLookUp Between Two Workbooks (No VBA)
问题
I have two workbooks - let's call them workbook1 & 2. In workbook1 I want Column A to be autofilled with information stored in workbook2. However, I have come into two problems.
- First, the formula returns a #N/A error in cell A2 of workbook1, despite being the same formula used in cells A3 & A4.
- Second, the formula returns the wrong value for A4 despite the formula being written as approximate match (True), and the text in column B being identical.
The formula in question is:
- (A2) =VLOOKUP([@[Vendor Name]],'Vendor Name-Code Cross Ref.xlsx'!Table1[#All],1)
- (A4) =VLOOKUP([@[Vendor Name]],'Vendor Name-Code Cross Ref.xlsx'!Table1[#All],1)
The workbooks are below in numerical order.
英文:
I have two workbooks - let's call them workbook1 & 2. In workbook1 I want Column A to be autofilled with information stored in workbook2. However, I have come into two problems.
- First, the formula returns a #N/A error in cell A2 of workbook1, despite being the same formula used in cells A3 & A4.
- Second, the formula returns the wrong value for A4 despite the formula being written as approximate match (True), and the text in column B being identical.
The formula in question is:
- (A2) =VLOOKUP([@[Vendor Name]],'Vendor Name-Code Cross Ref.xlsx'!Table1[#All],1)
- (A4) =VLOOKUP([@[Vendor Name]],'Vendor Name-Code Cross Ref.xlsx'!Table1[#All],1)
The workbooks are below in numerical order.
I apologize for the simplicity of this question. I have tried a couple of things, I found online including this answer here and here. And I can't get it to work. I am happy to try another formula if there is a better tool for the job. I have been away from Excel for a few months and can't recall how to set this up...sorry for the easy question. Also, as I am not all too familiar with VBA I have not tried a VBA solution and that is why I listed that in the title as such.
Thanks for your help.
答案1
得分: 2
-
INDEX/MATCH:
=INDEX('Vendor Name-Code Cross Ref.xlsx'!Table1[Vendor Code],MATCH([@[Vendor Name]],'Vendor Name-Code Cross Ref.xlsx'!Table1[Vendor Name],0))
-
在工作簿2中切换列顺序,并继续使用
VLOOKUP
,但要使用精确匹配。 -
如果您可以使用新的Excel函数,可以使用
XLOOKUP
。
英文:
Couple options:
-
INDEX/MATCH:
=INDEX('Vendor Name-Code Cross Ref.xlsx'!Table1[Vendor Code],MATCH([@[Vendor Name]],'Vendor Name-Code Cross Ref.xlsx'!Table1[Vendor Name],0))
-
Switch the column order in Workbook 2 and continue using
VLOOKUP
, but with exact match. -
If you have access to the new Excel functions, use
XLOOKUP
.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论