Vlookup Error

JadonR

Board Regular
Joined
Apr 15, 2009
Messages
154
Office Version
  1. 365
I am using the following formula:

Code:
=IF(A$24="Yes",(VLOOKUP(Y3,'Purchasing Units'![B]A:B[/B],1,FALSE)),"1")
I would like the vlookup to start at A3 instead of the entire A column, so I tried the following:

Code:
=IF(A$24="Yes",(VLOOKUP(Y3,'Purchasing Units'![B]A3:B50[/B],1,FALSE)),"1")
When I change the A:B to A3:B50, I get a #NA error (or sometimes #NAME). What am I doing wrong?
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
With either formula, with the col_index_num set to 1, it will be looking in Column A, not Column B. Is that what you intended?

Matty
 
Upvote 0
I am using the following formula:

Code:
=IF(A$24="Yes",(VLOOKUP(Y3,'Purchasing Units'![B]A:B[/B],1,FALSE)),"1")
I would like the vlookup to start at A3 instead of the entire A column, so I tried the following:

Code:
=IF(A$24="Yes",(VLOOKUP(Y3,'Purchasing Units'![B]A3:B50[/B],1,FALSE)),"1")
When I change the A:B to A3:B50, I get a #NA error (or sometimes #NAME). What am I doing wrong?
Can you explain in words what you're wanting to do?

If you're using column index number 1 then you only need to use column A in your table array argument.

Also, you should not quote numbers to be the results of a formula. Quoting numbers turns them into TEXT strings which may lead to problems if you have to do calculations on the results of this formula.
 
Upvote 0
Ok, I would like to use a vlookup to get a number from Col A on the 'Purchasing Units' tab. If it doesn't match any of the numbers from cells A3 through A50, then I want it to return the number 1.

And of course I only want it to do this if A24 = Yes.
 
Upvote 0
Ok, I would like to use a vlookup to get a number from Col A on the 'Purchasing Units' tab. If it doesn't match any of the numbers from cells A3 through A50, then I want it to return the number 1.

And of course I only want it to do this if A24 = Yes.
OK, try this...

=IF(A24="Yes",IF(COUNT(MATCH(Y3,'Purchasing Units'!A$3:A$50,0)),Y3,1),"")
 
Upvote 0
I realized the solution is already given, just wanted to offer another solution.

=IF(A24="yes",IF(ISNUMBER(MATCH(Y3,'Purchasing Unit'!$A$3:$A$50,0)),"",1))
 
Upvote 0
I realized the solution is already given, just wanted to offer another solution.

=IF(A24="yes",IF(ISNUMBER(MATCH(Y3,'Purchasing Unit'!$A$3:$A$50,0)),"",1))
The logical test =IF(A24="yes" doesn't have a value_if_false argument so will default to FALSE.

If the lookup value is found then return the lookup value otherwise return 1.
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,722
Members
452,939
Latest member
WCrawford

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