Search code examples
excelexcel-formulaconditional-statementsvlookup

I need to combine these two formulas


I need to combine the following

=IF(B2="SUSP","Suspended",A2) and =VLOOKUP(A2,Lookup!AB:AC,2,0)

explanation: If SUSP isn't found in cell B2 then match value from column AB in 'lookup' tab and then return the value from AC in the 'lookup' tab.


Solution

  • Excel allows the "Nesting" of formula, so just put the VLOOKUP in the False position. That way when it does not equal "SUSP" it will run the VLOOKUP:

    =IF(B2="SUSP","Suspended",VLOOKUP(A2,Lookup!AB:AC,2,0))
    

    If B2 does eqaul "SUSP" the IF will not even run the VLOOKUP.