Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
SKY
 
Posts: n/a
Default Extract data from one worksheet

I would like to extract matched data from one worksheet and put into another.
For example, a table contains two columns, country and city,
Country City
CN SZ
CN BJ
USA SEA
USA SFO

On a blank worksheet, enter "USA" in A1, how can I copy only the last two
rows?
I try INDEX & MATCH functions, it always finds the first row. How can I tell
the Excel to make a on-going MATCH until it finish an array?

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ardus Petus
 
Posts: n/a
Default Extract data from one worksheet

Use DataFilterAdvanced filter

As Criteria range enter Country as column header in A1, enter USA in A2
Criteria range: $A$1:$A$2

HTH
--
AP

"SKY" a écrit dans le message de
...
I would like to extract matched data from one worksheet and put into

another.
For example, a table contains two columns, country and city,
Country City
CN SZ
CN BJ
USA SEA
USA SFO

On a blank worksheet, enter "USA" in A1, how can I copy only the last two
rows?
I try INDEX & MATCH functions, it always finds the first row. How can I

tell
the Excel to make a on-going MATCH until it finish an array?



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default Extract data from one worksheet

In another column add

=IF(NOT(ISERROR(SMALL(IF($A$1:$A$40="USA",ROW($1:$ 40)),ROW(1:1))-MIN(ROW($A$
1:$A$40)))),
INDEX(A$1:A$40,SMALL(IF($A$1:$A$40="USA",
ROW($1:$40)),ROW(1:1))-MIN(ROW($A$1:$A$40))+1,1),"")

which is an array formula, it should be committed with Ctrl-Shift-Enter, not
just Enter.

Copy this formula acroos to the next column, and down as far as you need.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"SKY" wrote in message
...
I would like to extract matched data from one worksheet and put into

another.
For example, a table contains two columns, country and city,
Country City
CN SZ
CN BJ
USA SEA
USA SFO

On a blank worksheet, enter "USA" in A1, how can I copy only the last two
rows?
I try INDEX & MATCH functions, it always finds the first row. How can I

tell
the Excel to make a on-going MATCH until it finish an array?



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
SKY
 
Posts: n/a
Default Extract data from one worksheet

Hi, Bob,

Thanks for your help, I copy the formula and it is working. Please excuse me
as a beginner but yet trying to get the job done.

Can you show me the next formula to copy the corresponding cell to the next
column, that means, have both country and city as a result,

USA SEA
USA SFO

Yours,
SKY


"Bob Phillips" wrote:

In another column add

=IF(NOT(ISERROR(SMALL(IF($A$1:$A$40="USA",ROW($1:$ 40)),ROW(1:1))-MIN(ROW($A$
1:$A$40)))),
INDEX(A$1:A$40,SMALL(IF($A$1:$A$40="USA",
ROW($1:$40)),ROW(1:1))-MIN(ROW($A$1:$A$40))+1,1),"")

which is an array formula, it should be committed with Ctrl-Shift-Enter, not
just Enter.

Copy this formula acroos to the next column, and down as far as you need.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"SKY" wrote in message
...
I would like to extract matched data from one worksheet and put into

another.
For example, a table contains two columns, country and city,
Country City
CN SZ
CN BJ
USA SEA
USA SFO

On a blank worksheet, enter "USA" in A1, how can I copy only the last two
rows?
I try INDEX & MATCH functions, it always finds the first row. How can I

tell
the Excel to make a on-going MATCH until it finish an array?




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default Extract data from one worksheet

Same formula, just copy it across as well as down.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"SKY" wrote in message
...
Hi, Bob,

Thanks for your help, I copy the formula and it is working. Please excuse

me
as a beginner but yet trying to get the job done.

Can you show me the next formula to copy the corresponding cell to the

next
column, that means, have both country and city as a result,

USA SEA
USA SFO

Yours,
SKY


"Bob Phillips" wrote:

In another column add


=IF(NOT(ISERROR(SMALL(IF($A$1:$A$40="USA",ROW($1:$ 40)),ROW(1:1))-MIN(ROW($A$
1:$A$40)))),
INDEX(A$1:A$40,SMALL(IF($A$1:$A$40="USA",
ROW($1:$40)),ROW(1:1))-MIN(ROW($A$1:$A$40))+1,1),"")

which is an array formula, it should be committed with Ctrl-Shift-Enter,

not
just Enter.

Copy this formula acroos to the next column, and down as far as you

need.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"SKY" wrote in message
...
I would like to extract matched data from one worksheet and put into

another.
For example, a table contains two columns, country and city,
Country City
CN SZ
CN BJ
USA SEA
USA SFO

On a blank worksheet, enter "USA" in A1, how can I copy only the last

two
rows?
I try INDEX & MATCH functions, it always finds the first row. How can

I
tell
the Excel to make a on-going MATCH until it finish an array?








  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
SKY
 
Posts: n/a
Default Extract data from one worksheet

Hi, Bob;

SKY again. After reading your formula in detail, I simply copy your formula
to the next cell, and be able to get CITY now.

Really appreciate your help, you are genius!

Yours,
SKY

"Bob Phillips" wrote:

In another column add

=IF(NOT(ISERROR(SMALL(IF($A$1:$A$40="USA",ROW($1:$ 40)),ROW(1:1))-MIN(ROW($A$
1:$A$40)))),
INDEX(A$1:A$40,SMALL(IF($A$1:$A$40="USA",
ROW($1:$40)),ROW(1:1))-MIN(ROW($A$1:$A$40))+1,1),"")

which is an array formula, it should be committed with Ctrl-Shift-Enter, not
just Enter.

Copy this formula acroos to the next column, and down as far as you need.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"SKY" wrote in message
...
I would like to extract matched data from one worksheet and put into

another.
For example, a table contains two columns, country and city,
Country City
CN SZ
CN BJ
USA SEA
USA SFO

On a blank worksheet, enter "USA" in A1, how can I copy only the last two
rows?
I try INDEX & MATCH functions, it always finds the first row. How can I

tell
the Excel to make a on-going MATCH until it finish an array?




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
How do I copy a graph and use the data in the new worksheet? Brendanluc Charts and Charting in Excel 9 February 9th 08 06:49 AM
Data From One Worksheet To Be Used In A Cell In A Different Worksheet ratt Excel Worksheet Functions 5 August 16th 05 03:13 AM
Extract data from one Worksheet to another extract data fr. one worksheet to anothe Excel Worksheet Functions 1 August 15th 05 07:11 PM
Printing data validation scenarios SJC Excel Worksheet Functions 14 July 24th 05 12:43 AM
How do I collect data from an interactive web worksheet and impor. worksheetmom Excel Discussion (Misc queries) 3 February 20th 05 12:38 AM


All times are GMT +1. The time now is 05:28 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"