Forum Discussion
Can we use VLookup to fill in fields from Scattered Data ?
There are several ways to solve this.
Two examples:
=SUMPRODUCT(--($A$2:$D$12=G2),$B$2:$E$12)
=IFERROR(VLOOKUP(G2,$A$2:$B$12,2,FALSE),VLOOKUP(G2,$D$2:$E$12,2,FALSE))
But the best option is to restructure the data so that you can use just one VLOOKUP().
I tried both methods but none of them is able to pull the values of Pink & Yellow. In the first method, the value is always coming to be "2500" and in the second method it's only filling in "TRUE" and no the value.
P.S. - I'm attaching the file where the problem is. Please have a look at it and tell me if you have a way to solve it.
Thank You in advance.
- Detlef_LewinMay 13, 2019Silver Contributor
I don't know why do still use the wrong VLOOKUP() and get a mixture of two formulas in one column.
There has to be only one formula in the column. Put in H2 and copy it down.
- siddharthbeamMay 16, 2019Copper Contributor
- Detlef_LewinMay 16, 2019Silver Contributor
Now there is only one cell with a formula and it is not correct.
First you moved the data from column G to column F and second the formula is in G7 and references the criteria in G2 - which now makes no sense.
The correct formula for - now - G3 is:
=SUMPRODUCT(--($A$2:$D$12=F3),$B$2:$E$12)