Formula with nested IF statements, VLOOKUPs, and IFERROR statements - error message

Copper Contributor

I am trying to create a price column that will bring in pricing information from a price sheet. There are six different vendors (I am creating one IF statement for each vendor) and the correct value for "ModelFamily" can be in three different columns which is why I have so many IFERROR functions.

The function below works perfectly, however when I try to add another IF statement I get the following error: "You entered too many arguments for this function".

Does anyone know what could be wrong? Any help would be appreciated :)

Working function:

=IF([@Vendor] = "Vendor1", IFERROR(VLOOKUP([@ModelFamily],'[pricesheet.xlsx]PriceList'!$D:$X,21,FALSE),IFERROR(VLOOKUP([@ModelFamily],'[pricesheet.xlsx]PriceList'!$E:$X,20,FALSE),VLOOKUP([@ModelFamily],'[pricesheet.xlsx]PriceList'!$C:$X,22, FALSE))))

Error function:

=IF([@Vendor] = "Vendor1", IFERROR(VLOOKUP([@ModelFamily],'[pricesheet.xlsx]PriceList'!$D:$X,21,FALSE),IFERROR(VLOOKUP([@ModelFamily],'[pricesheet.xlsx]PriceList'!$E:$X,20,FALSE),VLOOKUP([@ModelFamily],'[Bulk - Master Tracker.xlsx]PriceList'!$C:$X,22, FALSE),IF([@Vendor] = "Vendor2", IFERROR(VLOOKUP([@ModelFamily],'[pricesheet.xlsx]PriceList'!$D:$Y,22,FALSE),IFERROR(VLOOKUP([@ModelFamily],'[pricesheet.xlsx]PriceList'!$E:$Y,21,FALSE),VLOOKUP([@ModelFamily],'pricesheet.xlsx]PriceList'!$C:$Y,23, FALSE))))))

1 Reply

@Vexum_ 

I guess it's like

=
IF( [@Vendor] = "Vendor1",
    IFERROR(VLOOKUP([@ModelFamily],'[pricesheet.xlsx]PriceList'!$D:$X,21,FALSE),
    IFERROR(VLOOKUP([@ModelFamily],'[pricesheet.xlsx]PriceList'!$E:$X,20,FALSE),
    VLOOKUP([@ModelFamily],'[Bulk - Master Tracker.xlsx]PriceList'!$C:$X,22, FALSE))),
IF( [@Vendor] = "Vendor2",
    IFERROR(VLOOKUP([@ModelFamily],'[pricesheet.xlsx]PriceList'!$D:$Y,22,FALSE),
    IFERROR(VLOOKUP([@ModelFamily],'[pricesheet.xlsx]PriceList'!$E:$Y,21,FALSE),
    VLOOKUP([@ModelFamily],'pricesheet.xlsx]PriceList'!$C:$Y,23, FALSE))) ))