Triple if statement in Excel?

Just seeing if anybody can help me out. I am getting lost in my written statements:

The formula I am trying to write is in Column AV.

Column G is "Current #" Column AZ is "Optimized #"

Column BB is for Strictly for Removals and can have multiple #’s separated by a comma.

If # in column ba = then replace, if its in BB then remove, If device type = RET then Retain.

=IF(VLOOKUP((@(Device ‘#)),OPT_300Carlton((Replacing ‘#):(Device Type ‘#)),6,FALSE)="RET","Retain Use New#",IF(VLOOKUP((@(Device ‘#)),OPT_300Carlton((Replacing ‘#):(Device Type ‘#)),1,FALSE)=(@(Device ‘#)),"Replace Use New#","Remove Use New"))

THis is what I written, but its failing because of too many functions.