Mar 19 2024 01:53 PM
Hello,
I need help creating a VLOOKUP formula to fill Sheet 1. This is based on reference data that is contained within Sheet 2. An example of what the results should look like is shown within Sheet 3.
I do not want the formula to populate any #N/A or 0. I need the cells to be blank if no data is found.
Sheet 1 (DATASET)
Sheet 2 (REFERENCE DATA)
Sheet 3 (EXAMPLE - FINAL)
Thanks!
Mar 19 2024 02:11 PM
Try this:
=FILTER(Tabelle2!$B$2:$D$4,Tabelle2!$A$2:$A$4=B2)&""
Mar 21 2024 01:40 PM
Mar 21 2024 01:54 PM
Mar 21 2024 01:58 PM
SolutionFILTER is available in Microsoft 365 and Office 2021, not in older versions.
In C2:
=IFERROR(IF(VLOOKUP($B2,'REFERENCE DATA'!$A$2:$D$4,COLUMN()-1,FALSE)="","",VLOOKUP($B2,'REFERENCE DATA'!$A$2:$D$4,COLUMN()-1,FALSE)),"")
Replace REFERENCE DATA with the actual name of the data sheet.
Fill to the right to column E, then down to row 4 (or vice versa).
Mar 21 2024 02:50 PM
This worked. Thank you @HansVogelaar
Mar 21 2024 03:28 PM
So my solution will be even less use to the OP !
= REDUCE(Group, {1,2,3},
LAMBDA(acc,k,
HSTACK(acc, XLOOKUP(Group, groupRef, CHOOSECOLS(results,k)))
)
)
Mind you, it does provide another opportunity to take a dig at Microsoft for failing to deal with this everyday issue! Clearly the formula should read
= XLOOKUP(Group, groupRef, results)
OK, perhaps that is a bit harsh because the result is an array of Ranges, but I certainly expect arrays of arrays to be fundamental objects that occur in most formulae!
Mar 21 2024 01:58 PM
SolutionFILTER is available in Microsoft 365 and Office 2021, not in older versions.
In C2:
=IFERROR(IF(VLOOKUP($B2,'REFERENCE DATA'!$A$2:$D$4,COLUMN()-1,FALSE)="","",VLOOKUP($B2,'REFERENCE DATA'!$A$2:$D$4,COLUMN()-1,FALSE)),"")
Replace REFERENCE DATA with the actual name of the data sheet.
Fill to the right to column E, then down to row 4 (or vice versa).