![]() |
![]() |
|
|||||||
| 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: Feb 2002
Posts: 97
|
I am using the vlookup function and sometimes I get the !#N/A. What can I do to change the !#N/A result for zero.
Thanks |
|
|
|
|
|
#2 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
|
Quote:
=IF(COUNTIF(D2:D5,A1),VLOOKUP(A1,D2:E5,2,0),0) where D2:D5 is the range that houses the lookup table, A1 a lookup value, D2:D5 within COUNTIF is the 1st column of the lookup table. By the way, 0 in VLOOKUP stands for FALSE, a shorter way of saying the same. If your match-type is TRUE, use: =IF(ISNUMBER(MATCH(A1,D2:D5)),VLOOKUP(A1,D2:E5,2),0) Aladin |
|
|
|
|
|
|
#3 | |
|
Board Regular
Join Date: Mar 2002
Location: New York
Posts: 71
|
Quote:
__________________
Bob Umlas Excel MVP Author of "This Isn't Excel, it's Magic!" http://www.iil.com/iil/excelmagic |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|