Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1566
  • Last Modified:

vlookup function assistance

Dear experts,

I'm stuck trying to create a vlookup function which is not returned desired results.

Could I get some assistance to determine why the function is not returning the values I am looking for.   Please see attached and let me know if you have any question.

Thanks for your help!

lcha
VLOOKUP.xlsx
0
lcha
Asked:
lcha
  • 3
  • 2
3 Solutions
 
lchaAuthor Commented:
=VLOOKUP(H4,$C$4:$D$13,COLUMN(D4),FALSE)

I am searching for the value in H4, searching table array $c$4:$D$13, column(d4) is the value I want to retrieve, and false to search for an exact match.

i tried changing the FALSE value to TRUE (to search for the closest match), but get the same results.
0
 
ltswebCommented:
You want the formula:  =VLOOKUP(H4,C$4:D$13,2,FALSE)

This will return the Cust_Acct_Stat_Code based on the account number value.  For accounts that don't exist, it will return the value #N/A.

The first value is the lookup variable, second is the range, third is the column number, and fourth is whether you want an exact match.  Exact match is False.  Makes no sense, but hey, it is Microsoft, so it makes sense to someone!

Hope this helps!

Regards!
0
 
lchaAuthor Commented:
thank you so much for the quick reply.
 this worked for the sample spreadsheet I provided you however for some reason in the real spreadsheet doesn't work.

The value I am looking for (65001328 - value in cell I4) is in the array (see formula below).   Vlookup does a search for this value in column 1 of the array.   It's there, but the formula is still returning #N/A

=VLOOKUP(I4,$E$2:$F$1029,2,FALSE)

Any insights into what may be causing this issue?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
ltswebCommented:
Hmm,
That is strange, that should work.

Do you have cells I4 and E4 the same data type, say number or text?

Try removing the $ in front of E and F - it shouldn't matter, but that is different than the sample spreadsheet.

Copy and paste a few of the lines from the "real" spreadsheet into a new spreadsheet and attach it.  Of course, remove anything that is confidential!

I think there may be something different between I4 the value you are matching in E4.  I noticed in your sample that account numbers 1-4 were not formatted as numeric.  If you see a green flag in the cell, convert the account to a number and it should work.  If it doesn't try converting it to text.
0
 
Rob HensonIT & Database AssistantCommented:
As an aside, the reason why the COLUMN(D4) section wasn't working:

COLUMN(D4) will return the value 4 as D is the fourth column of the sheet and you are only looking for column 2 of the Array.

Thanks
Rob H
0
 
lchaAuthor Commented:
Thanks all for your feedback and help on this issue!

One of the columns was General format and the other was text.

to fix it, I highlighted the column i needed to change format, went to "data", "text to columns", selected delimited, tab, and the general format.   This fixed the issue.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now