vlookup & if found #N/A get another column value

hsandeep

Well-known Member
Joined
Dec 6, 2008
Messages
1,224
Office Version
  1. 2010
Platform
  1. Windows
  2. Mobile
In workbook2 I am doing vlookup to get values from workbook1 (Sheet1). Criteria is: If the value in the Col_index_num is null or #N/A then I want value from another column.
Ex:
Workbook1
A1=PPP-100 B1=PETER C1=#N/A
Workbook2
A1=PPP-100
D1 (output where formula is required)=vlookup(A1,Table_array,3,0) is giving #N/A (C1) but then I require B1 i.e. Answer=PETER
How to accomplish?
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Hi,

first attempt.

I'm using Excel 2000

=IF(ISERROR(vlookup(A1,Table_array,3,0),
vlookup(A1,Table_array,2,0),vlookup(A1,Table_array,3,0))

If you're are using Excel 2007 or more

=IFERROR(vlookup(A1,Table_array,3,0),vlookup(A1,Table_array,2,0))

Hope it helps you to find the right solution.

Cheers
 
Upvote 0
Or D1 :

=VLOOKUP(A1,Table_array,ISTEXT(C1)+2,0)

Regards
 
Upvote 0

=IFERROR(vlookup(A1,Table_array,3,0),vlookup(A1,Table_array,2,0))

If C1=null then?
 
Upvote 0
[QUOTE

=IFERROR(vlookup(A1,Table_array,3,0),vlookup(A1,Table_array,2,0))
This did not work. Should it be other way round?
 
Upvote 0

Hi all,


=IF(OR(ISERROR(
vlookup(A1,Table_array,3,0)),vlookup(A1,Table_array,3,0)="null")),vlookup(A1,Table_array,2,0),vlookup(A1,Table_array,3,0))


Hope parentheses are correct and the formula has some logic.

Cheers


------------------
Ciao Patel45
 
Last edited:
Upvote 0

Hi again,

maybe

=IF(OR(ISERROR(
vlookup(A1,Table_array,3,0)),ISBLANK(vlookup(A1,Table_array,3,0))),vlookup(A1,Table_array,2,0),vlookup(A1,Table_array,3,0))

I'm sure you'll get more elegant solutions from the Forum

Cheers
 
Upvote 0
Hi,

Try

=IF(OR(vlookup(A1,Table_array,3,0)=#NA,vlookup(A1,Table_array,3,0)=""),vlookup(A1,Table_array,2,0),vlookup(A1,Table_array,3,0))

Jai
 
Upvote 0

Forum statistics

Threads
1,217,413
Messages
6,136,478
Members
450,016
Latest member
murarj

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top