Forum Discussion
Karateka95
Sep 12, 2024Copper Contributor
VLOOKUP returning #N/A when using text
Hi there, Please see attached a copy of the workbook I'm building, or see this link: https://1drv.ms/x/c/e0c0b13a875a27d1/ERdu4SadbW5EkYvStiVi9gsB5xyxB5menKJAP0Wq6rtajQ The idea is when I typ...
- Sep 12, 2024
VLOOKUP works from left to right, i.e. lookups the value in left most column and if returns the value in matched row from the column in next parameter.
In your case works, for example, INDEX/MATCH
=IFNA( INDEX( INDEX( AllCards, 0, MATCH(TestDeckMain[[#Headers],[ATTRIBUTE]], AllCards[#Headers], 0) ), MATCH(TestDeckMain[@[NAME]:[NAME]], AllCards[[NAME]:[NAME]], 0 ) ), "" )
Please check in attached.
Karateka95
Sep 12, 2024Copper Contributor
Strange, it said anyone with the link can edit. I've added an attachment HansVogelaar
HansVogelaar
Sep 12, 2024MVP
Thanks. VLOOKUP searches for the lookup value in the 1st column of the lookup range, but the name is in the 4th column.
Option 1:
In D2:
=IF($C6<>"",VLOOKUP(TRIM($C6),AllCards[[NAME]:[DEF]],2,FALSE),"")
Note that the column index has shifted.
Option 2, if you have Microsoft 365 or Office 2021:
=XLOOKUP($C6,AllCards[[NAME]:[NAME]],AllCards[ATTRIBUTE],"")
- Karateka95Sep 12, 2024Copper ContributorThanks, this worked pretty well too. Unfortunately no 365 or retail package to use XLOOKUP, but it's good to see there's always a way around