在两个工作簿之间进行VLookUp(无需VBA)。

huangapple go评论65阅读模式
英文:

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.

在两个工作簿之间进行VLookUp(无需VBA)。

在两个工作簿之间进行VLookUp(无需VBA)。

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

  1. 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. 在工作簿2中切换列顺序,并继续使用 VLOOKUP,但要使用精确匹配。

  3. 如果您可以使用新的Excel函数,可以使用 XLOOKUP

英文:

Couple options:

  1. 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. Switch the column order in Workbook 2 and continue using VLOOKUP, but with exact match.

  3. If you have access to the new Excel functions, use XLOOKUP.

huangapple
  • 本文由 发表于 2020年1月7日 02:13:16
  • 转载请务必保留本文链接:https://go.coder-hub.com/59616942.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定