If conditional + Vlookups

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!!
 
J

JMB

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top