Selasa, 16 Agustus 2011

RE: [ExcelVBA] Excel VLookup - doesn't work

 

In essence vlookup looks up the first column of the target range and returns
the nth column. With your layout the value you want to return is before the
column you want to use as the index and vlookup will not do this. You could
try =LOOKUP(C2,sheet2!$C$2:$C$10248,sheet2!$A$2:$A$10248) if sheet2 is
sorted on col c. If not you will need to use MATCH to return the offset and
then feed that into a reference (I think it will need Indirect) something
like

=indirect("Sheet2!A"&match(C2, sheet2!$C$2:$C$10248,0)+1

Best Regards
David Grugeon
Excel VBA Group Moderator

-----Original Message-----
From: ExcelVBA@yahoogroups.com [mailto:ExcelVBA@yahoogroups.com] On Behalf
Of sheizageek
Sent: Wednesday, 17 August 2011 12:49 AM
To: ExcelVBA@yahoogroups.com
Subject: [ExcelVBA] Excel VLookup - doesn't work

I have two worksheets. Each has multiple columns, but the same column A
(ID) and Column C (Claim#). The first worksheet has 324 records and the
second worksheet has 10,248 records. I want to search for each claim # in
sheet1 to see if it exists in sheet2, and, if so, tell me the ID of the
second sheet. This is the formula that I used, but I only get the #N/A error
in every cell. =VLOOKUP(C2,sheet2!$A$2:$C$10248,3,FALSE)

I know that there are matches, but it doesn't show anything but the error.

Is this formula wrong? Does VLOOKUP search multiple worksheets/workbooks?
Should I do this using VBA instead? If so, what code?

Any assistance is appreciated.

Sharron Puryear

------------------------------------

----------------------------------
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go
here: http://www.mousetrax.com/techtrax to enter the ezine, then search the
ARCHIVES for EXCEL VBA.

----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA

----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com

----------------------------------Yahoo! Groups Links

__._,_.___
Recent Activity:
----------------------------------
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.

----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA

----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com

----------------------------------
.

__,_._,___

Tidak ada komentar:

Posting Komentar