![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Mar 2002
Posts: 103
|
Is there any way to get rid of the #N/A value that is returned when an item in the specified array cannot be found?
Thanks Will |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Millbank, London, UK
Posts: 1,790
|
have a look at the =ERROR.TYPE function which will give you a bit of grounding on the types of errors and how to spot/trap them
but for the #N/A error, I usually use the following (there's many different ways, hopefully you'll get other options too after this post) : =IF(ISNA(VLOOKUP(your stuff)=TRUE),"",VLOOKUP(your stuff)) which is basically saying : 1) if your vlookup is bringing back an N/A error, then put nothing otherwise 2)proceed with your vlookup
__________________
:: Pharma Z - Family drugstore :: |
|
|
|
|
|
#3 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,319
|
Quote:
If match-type (the 4th arg of VLOOKUP) is FALSE, use: =IF(COUNTIF(E2:E50,A2),VLOOKUP(A2,E2:H50,3,0),value-to-return-otherwise) where E2:E50 is the first column of the lookup-table in E2:H50 and 0 as the 4th arg of the VLOOKUP function is the same as FALSE. Finally, the value-to-return-otherwise can be "" or 0, up to you to decide. If match-type is TRUE, use: =IF(ISNUMBER(MATCH(A2,E2:E50)),VLOOKUP(A2,E2:H50,3),value-to-return-otherwise) where everything is the same as above, except for the 4th arg of VLOOKUP, here omitted. The omission means the same as 1 (or TRUE). I might add that using 0 or 1 (instead of FALSE or TRUE) in lookup functions is a perfectly sound habit. Aladin [ This Message was edited by: Aladin Akyurek on 2002-04-07 08:13 ] |
|
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Mar 2002
Posts: 103
|
thanks a lot for the replies, they were very helpful.
Will |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|