# Vlookup Returns #N/A When Lookup Value Is Not Found

Oct 29, 2008

This formula works perfectly except when worksheet 2 has a code that is not on worksheet 1, then I get the error #N/A. I understand why I get the error, but not how to fix it. Obviously some sort of nesting - but what and how?

What I want on worksheet 2, column I - if there is a code on worksheet 2 but not on worksheet 1 - a return of "N/A"...

## VBA- #N/A In Col A And If Found Then Msgbox Returns The Data

Nov 2, 2009

Macro that will look for #N/A in Col A and if found then msgbox returns the data in Col B, so as example shown below we can see there are 2 #N/A, so the msgbox should return "DAI.345, BBHT.WERFGT".

my real data will consist around 800 rows....

## Lookup Data Left Of Found Lookup Value

Nov 28, 2006

here is an example....

(this is on a sheet called Summary)

----A--------B --------C------- D
1Names----At Bats----Hits----Batting Average
2Tom-------38--------31------.816
3Derek------19--------14------.737
4Joey-------40--------28------.700
5Chris-------40--------27------.675
6Chuck------37--------24------.649

Using the LARGE function, Excel has created a list based on batting averages(on a separate sheet called Line-up). It looks like this.....

---A----------B
1Names----Averages
2 -----------.737
3 -----------.700
4 -----------.675
5 -----------.816
6 -----------.649

The problem I am having is figuring a way for Excel to also bring the corresponding names (after using the LARGE function to create the line up list).

## Lookup With Mutiple Returns

Dec 16, 2008

i am trying to lookup up when ppart matches spart and subtract total shipped from total produced. Here is where I am getting stuck .... because spart has multiple returns LOOKUP(2,1/((I2=C:C)),J2)

## Lookup With Multiple Possible Returns

Mar 31, 2009

I need to lookup a Order Number and return all associated Item Numbers. My spreadsheet has about 10,000 lines and these Order Numbers could have as little as 1 or as many as 15 Item Numbers associated. I would like to have a drop down on each Order Number that shows the Item Numbers.

## LOOKUP Returns Wrong Or Odd Value

Mar 27, 2007

I have a very basic spreadsheet to calculate golfer handicaps based upon a course index. For some reason, my "LOOKUP" formula is not retrieving the data from the cell (column) next to the value I am searching...?

## Lookup Function Returns #N/A Or #REF

Apr 23, 2007

Im trying to do a lookup but when I drag the formula down it returns the wrong values and also returns #N/A or #REF (which I think means it's refering to a wrong range and cant find the data???). How can I do a look up function by dragging the formula down a long column of data eg. 65,000 rows in excel, that returns the correct text. I have attached a simple example- see attached.

Apr 18, 2013

I have a sheet call Paste and one called look up -

On the lookup tab there is a list of accounts (the numbers of which varies perday) in column B - Using VBA I wish to do a vlookup on tab Paste looking in Column B and returning Column Cs value -

I have tried a few Codes that I have found online but in all cases whenever an account is not found the cose just stops rather than moving to next account

## Lookup - Formula Returns Wrong Value/sum

Jul 16, 2009

I am using this formula

## Lookup That Returns Multiple Values

Jun 9, 2009

I'm trying to do the next level of a v-lookup. I have a group of data with a text "flag" on certain rows. On my summary worksheet, I'm trying to do a lookup or a nested index function retrun all of the values with the text flag next to it.

I've been playing around with nested formulas and this is where I'm stuck. Here's what I came up with:

=INDEX(\$D\$1:\$E\$9,(SMALL(IF(\$D\$1:\$D\$9=\$A\$1,ROW(\$D\$1:\$D\$9),ROW(1:1)),ROW(1:1))),2)

This only works for one row and not for the other rows. Maybe I'm going down the wrong path?

## Display Message When Lookup Returns #N/A

Nov 21, 2007

I'm trying to generate a message box when a lookup cell returns the #N/A error value.

The lookup formula (=VLOOKUP(O8,Prod_Lookup,6,FALSE)) is in a "helper column" and returns a value of 0 if there is no entry in the lookup source sheet, but returns a value of #N/A if a non-matching date is entered in the active worksheet.

I have the following, but need some help in getting it work correctly. At present, it doesn't trigger the message box to pop up.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Dim Prod_Val As Range
Dim note1 As String

Set Prod_Val = Worksheets("C_Data").Range("P8:P7000")

note1 = "Brazer PPM cannot be calculated because the Daily Production Count" & vbLf & _
"has not been entered for this date." & vbLf & vbLf & _
"The Daily Production Count must be entered prior to entering the daily leak data." & vbLf & vbLf & _
"Upon clicking the OK button you will taken to the Production Count sheet to enter the data."

## Multiple Criteria Lookup Returns Name

Jan 12, 2008

I'm getting cross-eyed from trying to find the source of the error and not having any success. I've successfully used this approach many times, but for some reason I'm getting an error I can't pin down.

The problem: INDEX-MATCH lookup formula returns # NAME error. Formula: =INDEX(Data,MATCH(H8,Date,0),MATCH(\$I\$7,Line,0),MATCH("FPY",Hdngs,0)). I've done my best to verify the named ranges and cell references are correct and have stepped through the help file on the "potential source of the error", including going to Tools >Options and making sure "Accept Labels in Formulas" is checked, as well as having read a number of other posts.

## Vlookup Returns ###

Mar 18, 2009

I am using the formula =VLOOKUP(F4,Scoring!\$B\$3:\$C\$66,2,FALSE) in column 'G' to return values from another sheet, 'Scoring', if column 'F' has a name in it the value is returned. The problem is if column 'F' is blank the formula returns ### and I cannot SUM column 'G'.

## VLookup Returns #N/A :: How To Get Rid?

Apr 18, 2009

I have a vlookup formula for a table (attached), where for some reason, I cannot get rid of the #N/A value that is returned. I am referencing on the first sheet the 'No." column, and in checking for that number in the second column, am wanting to put the value in the 'moldules' column. I have tried converting the reference cells to text, numbers, have done =LEN to look at character counts, etc etc. I have also tried to build a simple dummy vlookup on a different set of data. The file is in Excel 07.

## VLOOKUP Returns Value From Different Row.

Feb 3, 2010

I want the A column to find it's match in the G column and place the corresponding number from the H column in the the B column. See attachment. formula is so basic: =VLOOKUP(\$A2,G1:H8806,2)

## VLOOKUP (returns A N/A Instead Of The Value Itself)

Feb 5, 2010

I have a problem with a spreadsheet that has three tabs. In Sheet1 is the first set of values and in Sheet2 is the second set of values. My boss wants me to make a third tab which pulls items from both sheets. He wants is so that any items from Sheet2 that AREN'T on Sheet1 are listed in the 3rd sheet. If they ARE listed on Sheet1, it returns a blank space. I can get it to return a blank space but every other value it pulls (In other words, values that are not on both sheets) returns a N/A instead of the value itself. Attached is the spreadsheet with just the values. Here is the formula I use in the 3rd tab to pull the info:

=IF(VLOOKUP(Sheet2!\$A3,Sheet1!\$A\$1:\$A\$1044,1,FALSE),"",Sheet2!\$A3). Do I just use regular lookup or MATCH instead of VLOOKUP.

## VLookup Returns #N/A

Apr 28, 2006

Using the following formula, =VLOOKUP(A232,'[HEALTHLINK SPIFF 4-27-06.xls]Rep Total'!\$A\$2:\$D\$279,4,FALSE). returns #N/A in some cases - I would like it to return the value of Zero since I need to total the results column

## Vlookup Returns Zero

Jul 24, 2007

I am attempting to use Vlookup to reference data in another file. if I use the vlookup function it works just fine UNTIL i add data to the referenced file. Then the vlookup never finds the new data. example in the file "TOLA" which references the file "INVENTORY MASTER":

Formula entry:
=IF(\$B25="","",VLOOKUP(\$B25,'[INVENTORY MASTER.xls]INVENTORY'!\$A\$4:\$L\$3356,3))

Now, if the data 031110 is entered in B25 of the current sheet, and 031110 is in the A column of sheet INVENTORY MASTER.xls, the proper data appears. (Data from a couple of columns to the right as expected)

Now then, I have closed both INVENTORY MASTER and NOLA. Now I reopen INVENTORY MASTER and make additions to the sheet, save it and close it. Lets say I added items up to 03318, and there is valid data in the columns to the right (B through J). I save and close INVENTORY MASTER....

## Lookup Function Returns Type Mismatch?

Feb 23, 2014

I get a Type mismatch from this line:

x = Application.WorksheetFunction.Lookup(2, 1 / (Range("G7:P7") = "A"), Range("G7:P7"))

## VBA - Lookup For Value In A Range And Returns Its Column Header

Jan 16, 2014

I have a table (A1:C5)

A1:C1 contain the table headers
A2:C5 contain the data
A6 contains the value I want to search for I use this formula to return the column header of A6 A6=INDEX(A1:C1,SUMPRODUCT((A2:C5=A6)*COLUMN(A2:C5))) Now, if there are duplicate values in A2:C5, this will return more than one column header What I need is a vba code to view a msgbox with all column headers returned in this case

## Vlookup Formula Only Returns Ref# Or N/A

Oct 21, 2008

How to make vlookup work right? I have tried it once and it worked but I can't get it ot work again.

I changed the format to text for the data I using and the data I looking in to see if that would fix the ref# or N/a error.

Is the formatting one possible issue?

I am slow to vlookup but I used the formula as

1. the lookup value is the serial #

2. the table_array is the entire worksheet that I am searching in - or should I just use the column that hold the values I am looking for?

3. the column_index_num is ??

4. [range_lookup] is FALSE.

## Vlookup Returns #N/A :: Not The Correct Value

Nov 12, 2008

I use a lot of VLOOKUP formulae in the sheets i put together and, despite both the lookup value and table array being in the same format (usually text format), i often get an #N/A being returned.

Here's the fun part... if i then do something simple like access the lookup value cell (either by double clicking or pressing F2) and then hit return, then the vlookup calculation suddenly returns the correct value.

I'm convinced it's something to do with the way the cells are formatted but can't work out what.

## Average From Vlookup Returns

Mar 11, 2009

I have an issue using the average formula (example attached). I need to calculate the average grade of a group of students. I have used VLOOKUP to convert grades to numbers. Then averaged these results and converted back. It appears to work for most results, but some are not working. I have messed about with cell formatting etc, but cannot seem to figure out why its not working for some rows but does for other rows?

## One Vlookup Returns Correct Value, Next Does Not

Mar 26, 2009

Looking for some help to figure out what is causing our problem. My friend has created the attached excel sheet in Excel 2003. The issue is that the a vlookup does not seem to be finding the correct line for the value from the lookup table when it is returned twice.

Let me explain - The details are contained in the attached workbook. There are three sheets in the workbook - NH3Curve, Samples and Qvalue table.

On the Samples sheet, in cell C12 and C13 you can enter varying values. Go across to F12 and F13 and you will see that they both have the value 22.1. This is where the issue occurs - in cells G12 and G13 the lookup value should be the same - but it is not. G12 is actually returning the value for 22.0 not 22.1. (lines 173 and 174 on the Qvalue sheet). We cannot ferret out why this is happening.

Any help would be greatly appreciated. Sometimes when you look at something you can't see the obvious, so I hope it is that simple.

## Multiple Returns With Vlookup

Mar 1, 2008

In this sample below, I need to extract all matches for my look up value. Where I extract the data to is not important because it will be used as informational data in user forms. Basically, I have 670 rows that make up this table...this table is static (never changes). Each row represents a unique combination for achieving the value on the left.

To take it a step further, I would like the ability to deviate from the lookup return...in other words, force the return to be one row down, or one row up (this would satisfy my first requirement as well). I tried offset with vlookup, but I cannot make that do anything useful. I used match to get the row number of the return, but I don't know what to do with that row value now that I have it sitting in a cell in order to accomplish this. I was thinking I could use an offset formula with the cell's value to get this done, but I could not figure out how without doing it in VBA.

In the end, I will present this data on a userform...first will be the actual vlookup returns, then the user will have an option to select the next row down if they want (same look up value if one exists) or up (next higher value).

If possible, I would like the data lookups to be accomplished without VBA.

This is an extremely large working application, (about 17MB so far), lots of VBA coding and logic applied. This problem is a result of a request from the users of this application.

Here is a sample of what I am looking at.....

## Sumproduct+ Vlookup, Returns #N/A

Apr 29, 2009

this formula works but returns #N/A when the result is false, how can i get rid of N/A but replace with 0.00 even though i have 0.00 as false

## Vlookup Returns 0's When Blank

Apr 2, 2003

=IF(LEN(G6),VLOOKUP(IF(ISNUMBER(G6+0),G6+0,G6),HistoryTable,4,0),"")

I would like this/a formula to return nothing when the cell in "HistoryTable" is blank. Right now it is returning a zero.

## VLOOKUP Returns #N/A! Error

Oct 28, 2006

I have a sheet that uses vlookup when the lookup returns #na error how can i conditional format these cells to so text is same as background

## Vlookup Returns 0 When Blank

Feb 16, 2007

I have a formula that references another worksheet. Using the VLOOKUP function, it works great, except if the data on the other worksheet has a blank cell, it then returns a 0 (zero). Within the formula below, cell E10 is my "unique key" and is the only raw data within this spreadsheet. All other cells are strictly formulas. This formula I am using below works perfectly if there is complete data, but that is not always the case. =IF(\$E10="","",IF(\$E10="~ None ~","",VLOOKUP(\$E10,Projects!\$F\$3:\$T\$226,5,FALSE)))

## Vlookup Returns Row Number

Apr 26, 2007

I'm used to using the VLOOKUP Function a lot, and up to now it has always worked fine.

Instead of returning the value of the looked up cell (text) as it usually does it seems to be returning a number, which has something to do with the row number of said cell.

I copy and paste a formula between sheets and it does the same so I'm pretty sure it's not something in the formula.