Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 03-22-2007, 03:44 PM   #1
usual suspect
 
hobey19's Avatar
 
Join Date: Jun 2002
Location: not here
Posts: 2,051
copy cells between sheets in excel based on data

i have two sheets in excel with common information (ie First and Last names). Sheet 1 contains Last Name, First Name and Age. Sheet 2 contains Name of School, Last Name, First Name and Phone Number. is there any easy way to have it compare the names in each of the two sheets and put corresponding Schools and Phone numbers in Sheet 1? there is a lot more data in Sheet 2 than i need, so straight copy/paste is out of the question. thanks in advance

craig
__________________
the universe is against this current wave of success i'm having. -johnny drama, entourage
hobey19 is offline   Reply With Quote
Old 03-22-2007, 04:51 PM   #2
Resident Slacker
 
homer15's Avatar
 
Join Date: Dec 2001
Location: Suisun City, California (i know, where the hell is that?!?!?)
Posts: 2,620
i don't know how your spreadsheet is laid out, so use this as your key
sheet1
a1= last name
b1= first name
c1= age
d1=(column to be added later)
e1=(column to be added later)

sheet2
a1= (column to be added later)
b1=school
c1=last name
d1=first name
e1=phone number


if you add a column to the left of school on sheet2, have that cell have the following formula:
=c1&d1
copy that formula all the way down to the last cell on the last row.

then, back to your sheet1, use the following forumla:

for school name, click on cell d1, and use the following formula
=vlookup(a1&b1,sheet2:A:Z,2)

for school name, click on cell e1, and use the following formula
=vlookup(a1&b1,sheet2:A:Z,5)
__________________
Friends help you move. REAL friends help you move bodies. - me
quite possibly the best book ever written... by me
homer15 is offline   Reply With Quote
Old 03-22-2007, 05:17 PM   #3
usual suspect
 
hobey19's Avatar
 
Join Date: Jun 2002
Location: not here
Posts: 2,051
thanks homer. just out of curiosity, what will this do if there are multiple people with the same name (ie John Taylor)

edit: i tried it and it didn't work, i get a #NAME error.

my setup, if it makes a difference-
Sheet 1 - Columns
A - Last Name
B - First Name
C - Age
D - Phone
E - School

Sheet 2 - Columns (only pertinent letters shown below)
A - first&last (as per your instructions)
B - School
D - Last Name
E - First Name
N - Phone

thanks
craig

Last edited by hobey19; 03-22-2007 at 05:23 PM.
hobey19 is offline   Reply With Quote
Old 03-22-2007, 05:21 PM   #4
Resident Slacker
 
homer15's Avatar
 
Join Date: Dec 2001
Location: Suisun City, California (i know, where the hell is that?!?!?)
Posts: 2,620
it'll find the first one on the list it comes across.

one way to check for potential problems like that is to use this formula:

=countif(a:a,a1)

(column a being the column we created on sheet2). if you copy that for every row, it'll tell you when there is more than one of that name combination (it'll show up as a number greater than 1). maybe you could deal with those on an individual basis if there aren't too many of them.
homer15 is offline   Reply With Quote
Old 03-22-2007, 07:26 PM   #5
usual suspect
 
hobey19's Avatar
 
Join Date: Jun 2002
Location: not here
Posts: 2,051
alright, i have been trying a couple of different things, and have found that the data is pretty bad. there are tons of missing values and so i am just going through a copy/pasting. most of the information is spread through 3 files, so i am hoping whatever i don't find in one, i will find in the other two. thanks homer, for your help

craig
hobey19 is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't format cells in Excel doctorgonzo Software Discussion & Support 12 08-31-2007 10:35 AM
Computer Acronyms Floppyman Computer Hardware 156 06-18-2006 06:25 AM
Wireless recommendations pointd Networking & Online Security 9 07-23-2004 02:52 PM
excel - deleting empty cells adrianlewis Software Discussion & Support 3 12-04-2003 09:59 PM
Excel data Formatting fifi Software Discussion & Support 1 06-07-2002 12:08 PM


All times are GMT -5. The time now is 07:26 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2