Home > other >  IF statement with Vlookup based on condition
IF statement with Vlookup based on condition

Time:11-24

I am currently refining my Google sheet for orders our company receives, but would like some help in creating a condition to an VLOOKUP formula.

To keep the sheet clean, text only appears on input of L column. We have a second sheet with a simple costing.

This is the formula;

=IF(CONCATENATE(L371)="","",VLOOKUP(L371,COSTING!F:G,2,false))

However, this works for only one supplier at the moment. Is there a way of adding a condition to take into account a second cell on the main sheet?

Example; Adding this into the VLOOKUP ...

If X371 = 'SUPPLIER NAME1' look here (L371,COSTING!F:G,2,false), If X371 = 'SUPPLIER NAME2' look here (L371,COSTING!M:N,2,false)

Still learning formulas, so haven't quite mastered how to combine statements. Any suggestions?

CodePudding user response:

Try

=IF(L371="","",if(X371="SUPPLIER NAME1",vlookup(L371,COSTING!F:G,2,false),If(X371="SUPPLIER NAME2",VLOOKUP(L371,COSTING!F:G,2,false))))
  • Related