简体   繁体   中英

VLOOKUP Not Returning Value

I have a workbook in Excel 2010 with several sheets. I'm trying to use a VLOOKUP to copy data from one sheet to another. Not all the original data is stored in one sheet. The ones that are stored in a second sheet are flagging an #N/A error. I tried adding the IF ISERROR line but now it's just defaulting to blank. When I flip it, it tells me that the formula contains an error.

Original:

=IF(ISERROR(VLOOKUP(E3,$B$3:$C$11,2,FALSE)),"",VLOOKUP(AT7, 'GROUP1'!A:O,10,FALSE))

Flipped:

=VLOOKUP(AT7,'BPT MNDM'!A:O,10,FALSE)), IF(ISERROR(VLOOKUP(E3,$B$3:$C$11,2,FALSE)),"")

What can I do to make it so that if the value isn't found in the first table/column it leaves it blank without leaving everything blank? Also, is there a way to check a second table if the lookup doesn't find the value, or searches a second column? For example, if it finds the value in Group1 but Col10 is blank then copy Col11, or if it doesn't find it in Group1 then check Group2 and do the same. Alternatively, is there a way to do this in VBA?

Any assistance would be greatly appreciated.

I think what you need is essentially "try a VLOOKUP referencing sheet1, but if it fails, try again sheet2, but if that fails try on sheet3...."

You will want to use =IFERROR(value, value_if_error)

It returns "value" if its not an error, else it retunrs value_if_error.

So I think you need something like: IFERROR(VLOOKUP(E3,$B$3:$C$11,2,FALSE),VLOOKUP(AT7, GROUP1!A:O,10,FALSE))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM