Forum Discussion
IF and VLOOKUP working incorrectly.
- Oct 17, 2022
Your VLOOKUP only looks at column D, not at column B of the Pivot sheet. Try
=IFERROR(INDEX(Pivot!E:E,MATCH(1,(Pivot!B:B=$D$1)*(Pivot!D:D=A2),0)),"")
Thank you for your help.
The default value of first argument in your Match function is 1. Can you explain more.?
=IFERROR(INDEX(Pivot!E:E,MATCH(1,(Pivot!B:B=$D$1)*(Pivot!D:D=A2),0)),"")
(Pivot!B:B=$D$1) returns a series of TRUE/FALSE values.
(Pivot!D:D=A2) also returns a series of TRUE/FALSE values.
In calculations, Excel treats TRUE as 1 and FALSE as 0, so the result of (Pivot!B:B=$D$1)*(Pivot!D:D=A2) is a series of 1s and 0s: 1 where both conditions are met, 0 otherwise.
MATCH(1,(Pivot!B:B=$D$1)*(Pivot!D:D=A2),0) searches for the first 1 and returns its position (or an error).
- littlevillageOct 18, 2022Iron Contributor
I actually got it, It's really beyond my imagination Excel is Excellent.
Thank you again for your helps.