2 questions on vlookup

wwbwb

Well-known Member
Joined
Oct 20, 2003
Messages
513
1. Is it possible to have vlookup grab information from the left instead of the right? If so, how? ex. the column it looks up is b and pulls from c, d, e, etc. I would like it to pull from a, without having to change the chart to work the way it normally does.

2. When using vlookup to find an exact match, how can I have it display nothing when it can't find anything? Currently it displays #n/a. I need it to show a blank.
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Hi,

For your first question, I think you are going to have to move the column over to the right of your lookup column. I can't imagine how else to do it.

For the second question, try replacing the formula

=vlookup()

with

=if(isna(vlookup()),"",vlookup())

That way if #N/A would have appeared, you get the fake empty cell instead.
 
Upvote 0
MDuff said:
jimboy said:
ctrlaltdel said:
=if(isna(vlookup()),"",vlookup())
isna is better than iserror, use instead of my formula...
Can i ask why is na is better than iserror?
thanks

This is written by NateO

To tack-on to Paddy's response, iserror() is just inefficient. Typically, I see this function paired with lookup(), match() or if(). All of which are expensive in their own right. Conceptuallly, it has to be much more efficient to test the error at hand, #n/a or div/o specifically than a function that tests for a host of potential application errors.

from this link;

http://www.mrexcel.com/board2/viewtopic.php?t=66812&postdays=0&postorder=asc&start=10
 
Upvote 0
wwbwb said:
1. Is it possible to have vlookup grab information from the left instead of the right? If so, how? ex. the column it looks up is b and pulls from c, d, e, etc. I would like it to pull from a, without having to change the chart to work the way it normally does.

2. When using vlookup to find an exact match, how can I have it display nothing when it can't find anything? Currently it displays #n/a. I need it to show a blank.

1] You can substitute INDEX with MATCH for looking up things from right to left. The following VLOOKUP formula -

=VLOOKUP(A1,D20:F100,3,0)

could also be achieved by -

=INDEX(F20:F100,MATCH(A1,D20:D100,0),0)

2] For a listing of ways around error messages in formulas, see -- http://216.92.17.166/board2/viewtopic.php?t=62102
 
Upvote 0
jimboy said:
MDuff said:
jimboy said:
ctrlaltdel said:
=if(isna(vlookup()),"",vlookup())
isna is better than iserror, use instead of my formula...
Can i ask why is na is better than iserror?
thanks

This is written by NateO

To tack-on to Paddy's response, iserror() is just inefficient. Typically, I see this function paired with lookup(), match() or if(). All of which are expensive in their own right. Conceptuallly, it has to be much more efficient to test the error at hand, #n/a or div/o specifically than a function that tests for a host of potential application errors.

from this link;

http://www.mrexcel.com/board2/viewtopic.php?t=66812&postdays=0&postorder=asc&start=10

Thanks I will start changeing some of my forumals then...
 
Upvote 0

Forum statistics

Threads
1,203,460
Messages
6,055,553
Members
444,796
Latest member
18ecooley

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