
Linking info in one sheet to another sheet
On 01/03/2003 15:51, in article
Quote:
> Here is what I want to do. If you cannot help me, perhaps you can
> send me somewhere online where some EXCEL guru can help.
> I am a volunteer working on a project where the organization
> uses Windows and I use a MAC. So as we both have Office, I am
> using EXCEL to store my information.
> This is a fund raising project. I have a 4 sheet workbook. Sheet
> one is my "new" info, listing names, gifts pledged, received, label
> and address info and the like.
> Sheet 4 is a copy of the organization membership files with all
> names and addresses and other info I need for my mail merges.
> Currently, because I cannot figure out how to make lookups work,
> I need to cut and paste the row from sheet 4 to sheet 1 each time
> we get a new pledge.
> This is SO stupid.
> I want to type the last name of the family into the names column
> on sheet1 and have EXCEL pull the rest of the information into
> the column that I need filled in.
> The two sheets have most of the same columns, though I added a
> few new ones for tracking dollars to sheet 1.
> Can someone help me link these sheets???
It's actually not that {*filter*}ce you get the hang of it... Make sure you
read XL's Help - it's gotten better each version and is reasonably good now
with XL01/v.X (you don't say what version you're using, but the following
will work for XL98/01/v.x):
Let's assume both worksheets 1 and 4 are laid out like this:
A B C D E F G
1 LName FName Addr_1 Addr_2 City State Zip
with additional columns in Sheet1.
In Sheet1, Cell A2 you enter a last name. Then you can pull the other info
with:
B2: =VLOOKUP(A2, Sheet4!A:G, 2, FALSE)
C2: =VLOOKUP(A2, Sheet4!A:G, 3, FALSE)
D2: =VLOOKUP(A2, Sheet4!A:G, 4, FALSE)
etc...
Adjust your ranges to suit, and copy down as far as necessary.
If you don't have data in A2, or if the name is not found in Sheet4, the
VLOOKUP function will return the #N/A error. To avoid that, you can trap
both conditions like this:
B2: =IF(A2="","",IF(COUNTIF(Sheet4!A:A, A2)>0,
VLOOKUP(A2,Sheet4!A:G,2,FALSE), "Not Found"))
The IF(A2="", "" portion returns a null string ("") if A2 has no data. The
COUNTIF(Sheet4!A:A, A2) statement returns a 0 (which is interpreted as
FALSE) if the value in A2 does not exist in Sheet4 column A, and a 1 (or
more if the value is duplicated), which is interpreted as TRUE. If it's TRUE
that the value exists, the VLOOKUP is performed, otherwise "Not Found" is
returned.
I'm going to anticipate, and guess that you'll have more than one entry with
the same last name, so you'll need to enter more than just the last name in
order to get your data. In that case you'll need to use a little different
strategy to pull the correct entry, and how best to do it depends a bit on
the actual layout of your data. If that's an issue post back with more
detail. Please don't attach a file, though!
--
Microsoft MVP/Mac