If conditional + Vlookups

  • Thread starter Thread starter Jen
  • Start date Start date
J

Jen

I am trying to return a value from two different worksheets using a unique
string attached to each rows on those two tables.
Here is my logic :
If my unique string exists on the first table, then return a value in
column2. If that column2 is blank, then return a value in column2 of second
table.
If my unique string does not exist on my first table then return a value in
column2 of second table.
Please help!!
 
assuming Table1 is in A1:B4 and Table2 is in A9:B11, you could try

=IF(SUMPRODUCT(--(A1:A4="yourstring"),--(B1:B4<>"")),
VLOOKUP("yourstring",A1:B4,2,0),VLOOKUP("yourstring",A9:B11,2,0))

if the string does not exist in the second table, you could get #N/A error -
wasn't sure what you want to do in that case, if anything.
 
Back
Top