VLOOKUP Error

Gesyca_is_joy

Board Regular
Joined
Apr 24, 2014
Messages
90
Office Version
  1. 365
Platform
  1. Windows
I am trying to write a VLOOKUP on "SHEET2" to pull information from a table on SHEET1 (See below).

The table in SHEET one is called "PriceLog" my formula looks like this: =VLOOKUP(C2,PriceLog,9,0)
Cell C2 in this formula is a cell that has a formula itself to return the lowest value per certain criteria. that cell is currently displaying the value $1.67
But everytime I put in that formula I get #N/A as the result. I would attach the file to this but I cannot attach anything for some reason.


Category SubCategory Note Qty Size Price Coupon/ Sale Unit Price Store Date
Baking Cake Mix 3 Each 5.00 $1.67 Sam's Club 30-Aug-15
Baking Cake Mix 1 Each 4.98 $4.98 Kroger's 30-Aug-15
Baking Cake Mix 1 Each 3.25 Yes $3.25 Wal-Mart


Also when I try to put a table in this post all I see is the code for the table not the table itself so I am sorry if the spacing on my sheet example is off. Thank you.
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
What is the actual range reference for PriceLog ?
And which column in that range contains the match for C2?
And which column in that range contains the corresponding value you want returned?
 
Upvote 0
PriceLog is A:J on Sheet1; I had a made it a table named "PriceBook" but when I got the error I thought the table might be that so I searched the columns instead. The table was made by me highlighting the rows and clicking 'format as table' so I thought that might be why it wasnt' working.

C2 is in 8th column
the value I want returned is in the 9th column
 
Upvote 0
PriceLog is A:J on Sheet1;
......
C2 is in 8th column
the value I want returned is in the 9th column

OK, the problem is that VLOOKUP only searches for the match in the leftmost column of the range.
So in this case, that's column A.
It's looking in column A for a match to C2
It doesn't find it, so it returns #N/A

You would need that to be
=VLOOKUP(C2,Sheet1!H:J,2,0)
 
Upvote 0
If you want to avoid using the VLOOKUP formula, you can look into the "Index" formula, combine with the "Match" formula. This is helpful when the result column is to the LEFT of the searching column.
 
Upvote 0
That worked wonderfully!! Ok so no I came across another issue.

I am using this formula to generate the value in C2 of the previous example: =MIN(IF((PriceBook[SubCategory]='Sub Categories'!A2)*(PriceBook[Coupon/ Sale]=""),PriceBook[Unit Price]))

this forumula works fine until I try to drag it down, the next row down (a3) has a formula that says this in it: =MIN(IF((PriceBook[SubCategory]='Sub Categories'!A3)*(PriceBook[Coupon/ Sale]=""),PriceBook[Unit Price]))

it is returning a blank but the correct value should be 3.50 based on the information entered into the table it is referencing.

Also if I rearrange the items in the A column to go into alabetical order the value in this field disappears as well

Can you help?
 
Upvote 0

Forum statistics

Threads
1,217,365
Messages
6,136,120
Members
449,993
Latest member
Sphere2215

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top