Search code examples
if-statementgoogle-sheetsgoogle-sheets-formulaarray-formulasgs-vlookup

Google Sheets VLOOKUP using arrayformula not working


I am trying to populate rows of data from another sheet using VLOOKUP and ARRAYFORMULA.

Here is the data where I am using arrayformula:

Cells with arrayformula

G2 has the formula:

=arrayformula(if(ISBLANK(E2:E),"",VLOOKUP(E2:E,'Product List'!$A$2:$C,2)*F2:F))

And here is the "Product List" from the other sheet:

Product List

As you can see, it is bringing in the wrong numbers:

enter image description here

What is wrong with my arrayformula that is making it do this?


Solution

  • If the content in column E is not an exact match to something in column A, it will pull the closest match. If you don't want this, you can fix this by adding FALSE as the fourth parameter in VLOOKUP. By adding FALSE as shown below, cells that are not a match will show as #N/A instead of an incorrect number.

    =ARRAYFORMULA(IF(ISBLANK(E2:E),"",VLOOKUP(E2:E,'Product List'!$A$2:$C,2,FALSE)*F2:F))
    

    Other than that, I don't see why the formula wouldn't work.