Excel/Vlookup for Multiple Columns
Expert: Miguel Zapico - 11/10/2009
QuestionWould you kindly assist me with formula that will look at the date in column 12, if there is no date, look at column 13, if there is no date, look at column 14 and if there is no date return "-" (if I do not put a place holder it returns a date of Jan 0, 1900). This is what I currently have.
=IF(VLOOKUP(Subject1,TABLEA,12,FALSE),VLOOKUP(Subject1,TABLEA,13,FALSE),VLOOKUP(Subject1,TABLEA,14,FALSE),"-)
When tested, column 12 is blank but instead of looking at column 13 it is going to column 14 first.
AnswerThe formula will have to be a bit more complicated, with nested ifs; something like:
=IF(VLOOKUP(Subject1,TABLEA,12,FALSE)<>"", VLOOKUP(Subject1,TABLEA,12,FALSE),IF(VLOOKUP(Subject1,TABLEA,13,FALSE)<>"",VLOOKUP(Subject1,TABLEA,13,FALSE),IF(VLOOKUP(Subject1,TABLEA,14,FALSE)<>"",VLOOKUP(Subject1,TABLEA,14,FALSE),"-")))
I have assumed that the condition to move along the columns is that the cell is not blank (<>""), but you can change it if needed.
Hope this helps,
Miguel