VLOOKUP returns #VALUE!

JoeKing

New Member
Joined
Jan 16, 2008
Messages
12
Is it possible to have VLOOKUP substitute the returned #VALUE! with a custom value, say a text string that says 'Not Available'

Basically I have a pricing tool that I perform a VLOOKUP on and if there is no price against an item, the result is #VALUE! but I want this to be the defined text I choose. Perhaps to complicate matters, the cells are formatted as Accounting with 2 decimal places, because these are prices.

Is this possible?
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Edit formula
=if(iserror(your formula),"Not Available",(your formula)

if you have Excel 2007 use
=iferror(your formula),"Not Available")
 
Upvote 0
Edit formula
=if(iserror(your formula),"Not Available",(your formula)

if you have Excel 2007 use
=iferror(your formula),"Not Available")
Thanks, what am I doing wrong please...

=IF(ISERROR(VLOOKUP(A1,'Sheet1'!$A$2:$C$1566,3),"Not Available"),((VLOOKUP(A1,'Sheet1'!$A$2:$C$1566,3)/$B$4*(1+$B$5)/(1-$B$6))))
 
Last edited:
Upvote 0
try this:
=IF(ISERROR(VLOOKUP(A1030,'Non Warranty Repair'!$A$2:$C$1566,3,false)),"Not Available",(VLOOKUP(A1030,'Non Warranty Repair'!$A$2:$C$1566,3)/$B$4*(1+$B$5)/(1-$B$6))
 
Upvote 0
Try...

If on Excel 2007 or later:

=IFERROR(VLOOKUP(A1,Sheet1!$A$2:$C$1566,3)/$B$4*(1+$B$5)/(1-$B$6),"Not Available")

Otherwise:

=LOOKUP(9.99999999999999E+307,CHOOSE({1,2},0,VLOOKUP(A1,Sheet1!$A$2:$C$1566,3)/$B$4*(1+$B$5)/(1-$B$6)))

If Sheet1!$A$2:$A$1566 is not in ascending order, change:

VLOOKUP(A1,Sheet1!$A$2:$C$1566,3)

to:

VLOOKUP(A1,Sheet1!$A$2:$C$1566,3,0)

Custom format the cell of the latter as:

[=0]"Not Available";General
 
Upvote 0
This seems to be working, so I guess a big thank you to you Aladin :)

Could you explain how it works, I am using Excel 2003 for my sins.
What does the =LOOKUP(9.99999999999999E+307,CHOOSE({1,2},0, part do and why the big number?
 
Upvote 0
This seems to be working, so I guess a big thank you to you Aladin :)

Could you explain how it works, I am using Excel 2003 for my sins.
What does the =LOOKUP(9.99999999999999E+307,CHOOSE({1,2},0, part do and why the big number?

You are welcome.

CHOOSE creates here a two-item set (array) like:

{0,2.4}

or

{0,#VALUE!}

LOOKUP with the big number (an Excel constant to be found under Excel's limits) will always return the last numeric value from such a set: 2.4 from the first set, 0 from the second.

http://www.mrexcel.com/forum/showthread.php?t=310278,

post #7, explains how LOOKUP works.
 
Upvote 0

Forum statistics

Threads
1,216,071
Messages
6,128,626
Members
449,460
Latest member
jgharbawi

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