VLOOKUP

tjott

New Member
Joined
Aug 12, 2002
Messages
2
Is there any way when a value is not found and Excel returns N/A to put in a blank?
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

ChrisUK

Well-known Member
Joined
Sep 3, 2002
Messages
675
use the isNA function as a front to your vlookup.

=if(isNA(vlookup(Value, Table, Offset, TRUE|FALSE))," ",vlookup(value,table,offset,TRUE|FALSE)))

HTH

Chris
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,209
On 2002-10-15 09:02, tjott wrote:
Is there any way when a value is not found and Excel returns N/A to put in a blank?

It seems my "war" for efficiency is not that widespread... :biggrin:

A couple of options...

(1.) Select all the cells of the lookup table, excluding the labels that you might have.

(2.) Go to the Name Box on the Formula Bar.

(3.) Type LTable (or something you like better as name) and hit enter.

Now use the following formula with built-in functions...

=IF(ISNUMBER(MATCH(lookup-value,INDEX(LTable,0,1),0)),VLOOKUP(lookup-value,LTable,ColumnIdx,0),"")

Or, install the morefunc.xll add-in from:

http://longre.free.fr/english/index.html

and use:

=IF(ISNA(SETV(VLOOKUP(lookup-value,LTable,ColumnIdx,0))),"",GETV())

These formulas avoid double computations that degrade performance.
 

DonkeyOte

MrExcel MVP
Joined
Sep 6, 2002
Messages
9,123

ADVERTISEMENT

ISNA is good but won't cater for all error types (like REF#) though I appreciate only NA was asked for.
 

applebyd

Active Member
Joined
May 27, 2002
Messages
348
I think it's been mentioned before although I can't find the thread.

If you use the ISERROR function you surpress ALL error messages.

This means you can't see if anything else has gone wrong.

Using the ISNA function just kills the most common one for the Vlookup.

Now if I can just find something that surpressed a #DIV/0 without using ISERROR I'll be really happy.

DaveA

Edit: to kill the Jonathon Ross spelling errors
This message was edited by applebyd on 2002-10-15 10:48
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,209
On 2002-10-15 10:46, applebyd wrote:
I think it's been mentioned before although I can't find the thread.

If you use the ISERROR function you surpress ALL error messages.

This means you can't see if anything else has gone wrong.

Using the ISNA function just kills the most common one for the Vlookup.

Now if I can just find something that surpressed a #DIV/0 without using ISERROR I'll be really happy.

DaveA

Edit: to kill the Jonathon Ross spelling errors
This message was edited by applebyd on 2002-10-15 10:48

Right. The incredible habit/insistence of using ISERROR is also a hallmark of the microsoft newsgroups. Another is not being disturbed at all by computing the same thing multiple times in the same formula.

Regarding #DIV/0!, we can test the denominator before the division takes place...

=IF(Denominator,Nominator/Denomitor,OtherwiseValue)

where each term itself can be a computation. Is this not satisfactoty?

Aladin
 

Forum statistics

Threads
1,144,056
Messages
5,722,256
Members
422,419
Latest member
Havok390

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
Top