Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
des des is offline
external usenet poster
 
Posts: 3
Default extracting data from one sheet based on data in another - VLookup?

I have a worksheet Sheet1 with a list of about 1,000 students, their
student numbers and information about their timetables. A second worksheet
Sheet2, has a much shorter list with just names and student numbers. I want
to use the second list of names and student numbers in Sheet2 as the basis
for extracting timetable information from Sheet1.

The format of the data in Sheet1 makes it difficult - maybe impossible - to
use VLookup. It uses multiple rows for each student, like this -

Nam1 Nam2 No. Per Subj Rm Teacher
Cho Ed 483729533 A Math 132 Karim
Cho Ed 483729533 B Eng 317 Wong
Cho Ed 483729533 C Geo 210 Smith
etc. for 9 rows for each student to cover all 9 periods of the day.

I can use VLookup to locate matches based on the student number, but it
works only for the FIRST match for each student number. In other words, I
can extract information about the first period (Per, Subj, Rm) but nothing
about the remaining 8.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default extracting data from one sheet based on data in another -VLookup?

One approach is to set up a new unique reference for each student and
each row in a helper column, like this:

=IF(C2="","",C"&"_"&COUNTIF(C$2:C2:C2))

Then you can make use of this as your lookup-vector. You would have to
use an INDEX/MATCH combination rather than VLOOKUP, unless you were to
insert a new column A in your Sheet1 and put the formula there (though
the references to column C would change to D).

Hope this helps.

Pete

On Feb 4, 2:11*am, des <livecamq.8.spamgourmet.com wrote:
I have a worksheet Sheet1 with a list of about 1,000 students, their
student numbers and information about their timetables. A second worksheet
Sheet2, has a much shorter list with just names and student numbers. I want
to use the second list of names and student numbers in Sheet2 as the basis
for extracting timetable information from Sheet1.

The format of the data in Sheet1 makes it difficult - maybe impossible - to
use VLookup. It uses multiple rows for each student, like this -

Nam1 Nam2 *No. * * * Per *Subj *Rm * Teacher
Cho *Ed * *483729533 *A * Math *132 *Karim
Cho *Ed * *483729533 *B * Eng * 317 *Wong
Cho *Ed * *483729533 *C * Geo * 210 *Smith
etc. for 9 rows for each student to cover all 9 periods of the day.

I can use VLookup to locate matches based on the student number, but it
works only for the FIRST match for each student number. In other words, I
can extract information about the first period (Per, Subj, Rm) but nothing
about the remaining 8.


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default extracting data from one sheet based on data in another -VLookup?

Sorry, I've just spotted a spurious colon and quotes. The formula
should have been:

=IF(C2="","",C2&"_"&COUNTIF(C$2:C2,C2))

Hope this helps.

Pete

On Feb 4, 2:28*am, Pete_UK wrote:
One approach is to set up a new unique reference for each student and
each row in a helper column, like this:

=IF(C2="","",C"&"_"&COUNTIF(C$2:C2:C2))

Then you can make use of this as your lookup-vector. You would have to
use an INDEX/MATCH combination rather than VLOOKUP, unless you were to
insert a new column A in your Sheet1 and put the formula there (though
the references to column C would change to D).

Hope this helps.

Pete

On Feb 4, 2:11*am, des <livecamq.8.spamgourmet.com wrote:



I have a worksheet Sheet1 with a list of about 1,000 students, their
student numbers and information about their timetables. A second worksheet
Sheet2, has a much shorter list with just names and student numbers. I want
to use the second list of names and student numbers in Sheet2 as the basis
for extracting timetable information from Sheet1.


The format of the data in Sheet1 makes it difficult - maybe impossible - to
use VLookup. It uses multiple rows for each student, like this -


Nam1 Nam2 *No. * * * Per *Subj *Rm * Teacher
Cho *Ed * *483729533 *A * Math *132 *Karim
Cho *Ed * *483729533 *B * Eng * 317 *Wong
Cho *Ed * *483729533 *C * Geo * 210 *Smith
etc. for 9 rows for each student to cover all 9 periods of the day.


I can use VLookup to locate matches based on the student number, but it
works only for the FIRST match for each student number. In other words, I
can extract information about the first period (Per, Subj, Rm) but nothing
about the remaining 8.- Hide quoted text -


- Show quoted text -


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,180
Default extracting data from one sheet based on data in another -VLookup?

Excel 2007
Macro, Tables, Tested
http://www.mediafire.com/file/wym3ynmmhku/02_04_09.xlsm

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
extracting data from one worksheet based on another - VLookup? des Excel Discussion (Misc queries) 2 February 4th 09 12:27 PM
Extracting Data from another worksheet based on user input Alvyn Excel Worksheet Functions 14 August 6th 08 05:41 PM
Extracting data from one sheet into another T Excel Worksheet Functions 2 February 8th 08 06:24 PM
Extracting data based on content loopkid1 Excel Discussion (Misc queries) 5 March 7th 06 03:08 PM
Please help. Extracting data from one sheet to another leeannemat New Users to Excel 2 February 11th 06 02:55 PM


All times are GMT +1. The time now is 12:34 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"