spill-the-beans
Board Regular
- Joined
- Feb 7, 2013
- Messages
- 52
Hi all
I have a dataset with 34 columns and ~5000 rows. In column G there is an index number. The index number goes down the column, increasing by 1 each time, eg in G2 the index is 1, in G3 the index is 2, in G4 the index is 3. . .
Data worksheet
[TABLE="width: 500"]
<tbody>[TR]
[TD]Columns A, B, C, D, E, F[/TD]
[TD]G - index number[/TD]
[TD]Columns H onwards[/TD]
[/TR]
[TR]
[TD]data[/TD]
[TD]1[/TD]
[TD]data[/TD]
[/TR]
[TR]
[TD]data[/TD]
[TD]2[/TD]
[TD]data[/TD]
[/TR]
[TR]
[TD]data[/TD]
[TD]3[/TD]
[TD]data[/TD]
[/TR]
</tbody>[/TABLE]
In another worksheet, I have a list of index numbers that are needed. There is a start index number in column F and an end index number in column G; all the index numbers including the start/end and between them are needed.
Index worksheet
[TABLE="width: 500"]
<tbody>[TR]
[TD]Columns A, B, C, D, E[/TD]
[TD]F -start index[/TD]
[TD]G -end index[/TD]
[/TR]
[TR]
[TD]information[/TD]
[TD]25[/TD]
[TD]30[/TD]
[/TR]
[TR]
[TD]information[/TD]
[TD]47[/TD]
[TD]78[/TD]
[/TR]
[TR]
[TD]information[/TD]
[TD]90[/TD]
[TD]94[/TD]
[/TR]
</tbody>[/TABLE]
For example, if the start index was 25 and the end index was 30 in the index worksheet, I would need the all the data in every column in the data worksheet for the rows that have 25, 26, 27, 28, 29 or 30 in column G.
Information needed in the data worksheet
[TABLE="width: 500"]
<tbody>[TR]
[TD]Columns A, B, C, D, E, F[/TD]
[TD]G - index number[/TD]
[TD]Columns H onwards[/TD]
[/TR]
[TR]
[TD]unneeded data[/TD]
[TD]24[/TD]
[TD]unneeded data[/TD]
[/TR]
[TR]
[TD]needed data[/TD]
[TD]25[/TD]
[TD]needed data[/TD]
[/TR]
[TR]
[TD]needed data[/TD]
[TD]26[/TD]
[TD]needed data[/TD]
[/TR]
[TR]
[TD]needed data[/TD]
[TD]27[/TD]
[TD]needed data[/TD]
[/TR]
[TR]
[TD]needed data[/TD]
[TD]28[/TD]
[TD]needed data[/TD]
[/TR]
[TR]
[TD]needed data[/TD]
[TD]29[/TD]
[TD]needed data[/TD]
[/TR]
[TR]
[TD]needed data[/TD]
[TD]30[/TD]
[TD]needed data[/TD]
[/TR]
[TR]
[TD]unneeded data[/TD]
[TD]31[/TD]
[TD]unneeded data[/TD]
[/TR]
</tbody>[/TABLE]
Does anyone know how to either cut out the unneeded data or print a new worksheet with only the needed data? At the moment I've been going through manually deleting the rows outside the needed index numbers, but I was wondering if there is a way less prone to human error & stress?
I have a dataset with 34 columns and ~5000 rows. In column G there is an index number. The index number goes down the column, increasing by 1 each time, eg in G2 the index is 1, in G3 the index is 2, in G4 the index is 3. . .
Data worksheet
[TABLE="width: 500"]
<tbody>[TR]
[TD]Columns A, B, C, D, E, F[/TD]
[TD]G - index number[/TD]
[TD]Columns H onwards[/TD]
[/TR]
[TR]
[TD]data[/TD]
[TD]1[/TD]
[TD]data[/TD]
[/TR]
[TR]
[TD]data[/TD]
[TD]2[/TD]
[TD]data[/TD]
[/TR]
[TR]
[TD]data[/TD]
[TD]3[/TD]
[TD]data[/TD]
[/TR]
</tbody>[/TABLE]
In another worksheet, I have a list of index numbers that are needed. There is a start index number in column F and an end index number in column G; all the index numbers including the start/end and between them are needed.
Index worksheet
[TABLE="width: 500"]
<tbody>[TR]
[TD]Columns A, B, C, D, E[/TD]
[TD]F -start index[/TD]
[TD]G -end index[/TD]
[/TR]
[TR]
[TD]information[/TD]
[TD]25[/TD]
[TD]30[/TD]
[/TR]
[TR]
[TD]information[/TD]
[TD]47[/TD]
[TD]78[/TD]
[/TR]
[TR]
[TD]information[/TD]
[TD]90[/TD]
[TD]94[/TD]
[/TR]
</tbody>[/TABLE]
For example, if the start index was 25 and the end index was 30 in the index worksheet, I would need the all the data in every column in the data worksheet for the rows that have 25, 26, 27, 28, 29 or 30 in column G.
Information needed in the data worksheet
[TABLE="width: 500"]
<tbody>[TR]
[TD]Columns A, B, C, D, E, F[/TD]
[TD]G - index number[/TD]
[TD]Columns H onwards[/TD]
[/TR]
[TR]
[TD]unneeded data[/TD]
[TD]24[/TD]
[TD]unneeded data[/TD]
[/TR]
[TR]
[TD]needed data[/TD]
[TD]25[/TD]
[TD]needed data[/TD]
[/TR]
[TR]
[TD]needed data[/TD]
[TD]26[/TD]
[TD]needed data[/TD]
[/TR]
[TR]
[TD]needed data[/TD]
[TD]27[/TD]
[TD]needed data[/TD]
[/TR]
[TR]
[TD]needed data[/TD]
[TD]28[/TD]
[TD]needed data[/TD]
[/TR]
[TR]
[TD]needed data[/TD]
[TD]29[/TD]
[TD]needed data[/TD]
[/TR]
[TR]
[TD]needed data[/TD]
[TD]30[/TD]
[TD]needed data[/TD]
[/TR]
[TR]
[TD]unneeded data[/TD]
[TD]31[/TD]
[TD]unneeded data[/TD]
[/TR]
</tbody>[/TABLE]
Does anyone know how to either cut out the unneeded data or print a new worksheet with only the needed data? At the moment I've been going through manually deleting the rows outside the needed index numbers, but I was wondering if there is a way less prone to human error & stress?