#N/A result because data is on another worksheet

S

Steve

I have this formula which refers to the Master Tab.

=VLOOKUP($B4,MasterTab!$H$21:$O$923,8,FALSE)

It usually works great, however, when the data is not found ( because it's
on another worksheet ( Minor Tab!), I get a #N/A.

How can I re-write the formula that if the #N/A is produced, it does the
Vlookup on the Minor tab! instead of the master tab!

Something like: If =VLOOKUP($B4,MasterTab!$H$21:$O$923,8,FALSE) produces a
#N/A, VLOOKUP($B4,MinorTab!$H$21:$O$923,8,FALSE, if not, use this original
formula =VLOOKUP($B4,MasterTab!$H$21:$O$923,8,FALSE)

Thanks,

Steve
 
G

Glenn

Steve said:
I have this formula which refers to the Master Tab.

=VLOOKUP($B4,MasterTab!$H$21:$O$923,8,FALSE)

It usually works great, however, when the data is not found ( because it's
on another worksheet ( Minor Tab!), I get a #N/A.

How can I re-write the formula that if the #N/A is produced, it does the
Vlookup on the Minor tab! instead of the master tab!

Something like: If =VLOOKUP($B4,MasterTab!$H$21:$O$923,8,FALSE) produces a
#N/A, VLOOKUP($B4,MinorTab!$H$21:$O$923,8,FALSE, if not, use this original
formula =VLOOKUP($B4,MasterTab!$H$21:$O$923,8,FALSE)

Thanks,

Steve

=IF(ISNA(VLOOKUP($B4,MasterTab!$H$21:$O$923,8,FALSE)),
VLOOKUP($B4,MinorTab!$H$21:$O$923,8,FALSE),
VLOOKUP($B4,MasterTab!$H$21:$O$923,8,FALSE))
 
T

T. Valko

As long as the lookup value is on one or the other sheets...

=VLOOKUP($B4,IF(COUNTIF(MasterTab!$H$21:$H$923,$B4),MasterTab!$H$21:$O$923,MinorTab!$H$21:$O$923),8,0)
 
S

Steve

Thank you very much. This worked great.

Steve

Glenn said:
=IF(ISNA(VLOOKUP($B4,MasterTab!$H$21:$O$923,8,FALSE)),
VLOOKUP($B4,MinorTab!$H$21:$O$923,8,FALSE),
VLOOKUP($B4,MasterTab!$H$21:$O$923,8,FALSE))
.
 
S

Steve

The lookup value would be on either the master sheet or the minor sheet, but
not both. There also may be a situation where it would not be on either.
Trying the formula, results in a #REF!

For the particular lookup value I'm using, that value in on the master sheet.
 
T

T. Valko

Trying the formula, results in a #REF!

Hmmm...

Works just fine for me. However:
There also may be a situation where it would not be on either.

In that case, the formula would return #N/A. So, what result do you want
when the lookup value isn't on either sheet?
 
S

Steve

Ok, It works now. You inadvertently had H -> H on the first Master tab
reference instead of H -> O, and I also eneterd it with both H's. Changing
the 2nd H to an O makes it work great.

Thanks,

Steve
 
S

Steve

#N/A will be ok.

Thanks,

T. Valko said:
Hmmm...

Works just fine for me. However:


In that case, the formula would return #N/A. So, what result do you want
when the lookup value isn't on either sheet?

--
Biff
Microsoft Excel MVP





.
 

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