ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   If conditional + Vlookups (https://www.excelbanter.com/excel-worksheet-functions/197030-if-conditional-vlookups.html)

Jen

If conditional + Vlookups
 
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!!

JMB

If conditional + Vlookups
 
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("yourstrin g",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.


"Jen" wrote:

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



All times are GMT +1. The time now is 07:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com