Developing and testing features or extensions for Microsoft Edge
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have 2 separated spreadsheets in a workbook. The first spreadsheet contains Column C with Codes listed and Column E wants to pick up a dollar value that is contained in the second spreadsheet corresponding to the same Account Code. The second spreadsheet Column A has the same Code as in the first spreadsheet and has a value either in Column D or in Column E. Which Formula Function should I use and what is the formula. I have tried XLOOKUP, VLOOKUP, MATCH and having errors such as N/A. "SPILL! and other. Please can someone help out
Developing and testing features or extensions for Microsoft Edge
Hi @Danusia Waite ,
I understand how frustrating it can be to deal with #N/A or #SPILL! errors when trying to pull values from another sheet. Let’s break it down and get it working.
Issue Summary:
Step-by-Step Guidance:
#N/A.=TRIM(C2) in a helper column to remove extra spaces. =XLOOKUP(C2, Sheet2!A:A, Sheet2!D:D, "Not Found")
This looks for the code in Sheet2 Column A and returns the value from Column D. =XLOOKUP(C2, Sheet2!A:A, Sheet2!D:D, XLOOKUP(C2, Sheet2!A:A, Sheet2!E:E, "Not Found"))
This first tries Column D, and if no value is found, checks Column E. =VLOOKUP(C2, Sheet2!A:D, 4, FALSE)
VLOOKUP cannot easily check two columns, so you would need a helper column if the value could be in either D or E.#N/A: lookup value not found (extra spaces or mismatched formatting)#SPILL!: the formula tries to return multiple results but cannot fit in the target cellI suggest using XLOOKUP if your Excel version supports it. It handles missing values gracefully and is easier to manage than VLOOKUP. Also, make sure the account codes in both sheets are consistent in formatting and free from extra spaces.
If this helps fix the issue and my answer was helpful - kindly follow the instructions here so others with the same problem can benefit as well.