ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Returning an alternative value if lookup cannot be found in array (https://www.excelbanter.com/excel-discussion-misc-queries/200926-returning-alternative-value-if-lookup-cannot-found-array.html)

Queen_Of_Thebes

Returning an alternative value if lookup cannot be found in array
 
I think I need to use an IF statement but I'm not sure how to do it ...

This is my current formula
=VLOOKUP(A6,Pricing!C1:D1871,2,0)

If this value, A6, cannot be found in the array I get the following returned
#N/A
If #N/A is returned I want Excel to put 0 (zero)

How do I do that please?

Don Guillett

Returning an alternative value if lookup cannot be found in array
 
Look in the help index for
ISNA
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Queen_Of_Thebes" wrote in
message ...
I think I need to use an IF statement but I'm not sure how to do it ...

This is my current formula
=VLOOKUP(A6,Pricing!C1:D1871,2,0)

If this value, A6, cannot be found in the array I get the following
returned
#N/A
If #N/A is returned I want Excel to put 0 (zero)

How do I do that please?



Pete_UK

Returning an alternative value if lookup cannot be found in array
 
Like this:

=IF(ISNA(VLOOKUP(A6,Pricing!C1:D1871,2,0)),0,VLOOK UP(A6,Pricing!
C1:D1871,2,0))

Hope this helps.

Pete

On Sep 1, 4:48*pm, Queen_Of_Thebes
wrote:
I think I need to use an IF statement but I'm not sure how to do it ...

This is my current formula
=VLOOKUP(A6,Pricing!C1:D1871,2,0)

If this value, A6, cannot be found in the array I get the following returned
#N/A
If #N/A is returned I want Excel to put 0 (zero)

How do I do that please?



Queen_Of_Thebes[_2_]

Returning an alternative value if lookup cannot be found in ar
 
Many thanks, this has worked a treat :)

"Pete_UK" wrote:

Like this:

=IF(ISNA(VLOOKUP(A6,Pricing!C1:D1871,2,0)),0,VLOOK UP(A6,Pricing!
C1:D1871,2,0))

Hope this helps.

Pete

On Sep 1, 4:48 pm, Queen_Of_Thebes
wrote:
I think I need to use an IF statement but I'm not sure how to do it ...

This is my current formula
=VLOOKUP(A6,Pricing!C1:D1871,2,0)

If this value, A6, cannot be found in the array I get the following returned
#N/A
If #N/A is returned I want Excel to put 0 (zero)

How do I do that please?




Pete_UK

Returning an alternative value if lookup cannot be found in ar
 
You're welcome - thanks for feeding back.

Pete

On Sep 1, 9:19*pm, Queen_Of_Thebes
wrote:
Many thanks, this has worked a treat :)



All times are GMT +1. The time now is 03:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com