Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default using vlookup, but error #N/A

Hi

I'm trying to type in a social security number and then write a vlookup formula for the next cell so it pulls up the patient's last name. The worksheet I need to pull the info from is called PATIENTS. That sheet is set up so that the first column has the social, then 2nd column is another identifying #, then the 3rd column is the patient's last name. The first box that I type in the social security number in the current worksheet is A5. This is the formula I've written:

=IF(ISNA(MATCH(A5,PATIENTS!$A$2:$A$2070,FALSE)),VL OOKUP(A5,PATIENTS!$A$2:$M$2070,3,FALSE)

But I keep getting the error message #N/A

Please help!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default using vlookup, but error #N/A

Try:

=IF(ISNA(VLOOKUP(A5,PATIENTS!$A$2:$A$2070,FALSE)), "",VLOOKUP(A5,PATIENTS!$A$
2:$C$2070,3,FALSE))

You can substitute "Record not found" for "".

--

Vasant


"ErinGertz" wrote in message
...
Hi,

I'm trying to type in a social security number and then write a vlookup

formula for the next cell so it pulls up the patient's last name. The
worksheet I need to pull the info from is called PATIENTS. That sheet is
set up so that the first column has the social, then 2nd column is another
identifying #, then the 3rd column is the patient's last name. The first
box that I type in the social security number in the current worksheet is
A5. This is the formula I've written:


=IF(ISNA(MATCH(A5,PATIENTS!$A$2:$A$2070,FALSE)),VL OOKUP(A5,PATIENTS!$A$2:$M$
2070,3,FALSE))

But I keep getting the error message #N/A

Please help!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default using vlookup, but error #N/A

1) Your formula is testing whether the result of the MATCH is #N/A. If that
returns TRUE (ie. the result is #N/A) then VLOOKUP is going to try and look
up something that the formula has established doesn't exist.
2) Your formula doesn't have a FALSE condition.

Try using this version:

IF(ISNA(MATCH(A5,PATIENTS!$A$2:$A$2070,FALSE)),"", VLOOKUP(A5,PATIENTS!$A$2:$
M$2070,3,FALSE))

Notice the additional ,"", which will return a blank if the test returns
TRUE.

--

Regards
Andy Wiggins
www.BygSoftware.com
Home of "Save and BackUp",
"The Excel Auditor" and "Byg Tools for VBA"


"ErinGertz" wrote in message
...
Hi,

I'm trying to type in a social security number and then write a vlookup

formula for the next cell so it pulls up the patient's last name. The
worksheet I need to pull the info from is called PATIENTS. That sheet is
set up so that the first column has the social, then 2nd column is another
identifying #, then the 3rd column is the patient's last name. The first
box that I type in the social security number in the current worksheet is
A5. This is the formula I've written:


=IF(ISNA(MATCH(A5,PATIENTS!$A$2:$A$2070,FALSE)),VL OOKUP(A5,PATIENTS!$A$2:$M$
2070,3,FALSE))

But I keep getting the error message #N/A

Please help!



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default using vlookup, but error #N/A

Thanks for the replies.

I tried the new formulas, with the empty quotes, but now I'm not getting
anything.

The PATIENTS worksheet is linked to an Access database through a query.
Could that have anything to do with it?

-Erin



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default using vlookup, but error #N/A

Are you sure your range is correct. i.e. the block of data that you want to
match too? Confirm that. Maybe you get n/a because the formula is not
looking at the entire range and thus doesn't pick up the match.

--
RONALD CROSS
"Erin Gertz" wrote in message
...
Thanks for the replies.

I tried the new formulas, with the empty quotes, but now I'm not getting
anything.

The PATIENTS worksheet is linked to an Access database through a query.
Could that have anything to do with it?

-Erin



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default using vlookup, but error #N/A

The data I want to match to is the social security number which is
located in the first column of the worksheet PATIENTS.

So I think its correct. What do you think?

-Erin



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default using vlookup, but error #N/A

The way you have described it; it is correct. The "" gives a blank only when
there is no match.

Are you sure that one set of SSNs is not formated as number and the other as
text? Text formatting causes unpredictable behavior.

--

Vasant


"Erin Gertz" wrote in message
...
The data I want to match to is the social security number which is
located in the first column of the worksheet PATIENTS.

So I think its correct. What do you think?

-Erin



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VLOOKUP IS ERROR PAL Excel Worksheet Functions 3 May 7th 10 08:28 AM
vlookup error RR Excel Worksheet Functions 1 March 31st 09 02:37 PM
VBA Vlookup Error Skip Bisconer Excel Discussion (Misc queries) 1 October 16th 08 08:51 PM
#N/A Error with VLOOKUP Dan Marr Excel Worksheet Functions 1 March 22nd 08 02:12 AM
vlookup error!! Samantha Excel Worksheet Functions 1 April 11th 05 11:02 AM


All times are GMT +1. The time now is 05:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"