Copying data based on a condition

G

Guest

I need to have excel automatically copy data based on a name

Example

User Data1 Data2 Data3 Data4 Name

So if a name is equal to "me" I need it to copy the entire line (information
from user to data4).
 
G

Guest

Venturing some thoughts ..

Assume source data in Sheet1, cols A to F from row1 down
where col F = names (names listed are assumed unique)

Then in another sheet, if the names are listed in A1 down
we could put in B1:
=IF(A1="","",INDEX(Sheet1!A:A,MATCH($A1,Sheet1!$F:$F,0)))
Copy B1 across to F1, then fill down to populate the required info from
Sheet1's cols A to E.
 
G

Guest

Venturing an alternative interp ..

Assume source data in Sheet1, cols A to F from row1 down
where col F = names
(names listed may not be unique, may appear multiple times in col F)

Then in another sheet, if a single name will be input in A1
Put in B1:
=IF($A$1="","",IF($A$1=Sheet1!F1,ROW(),""))

Put in C1:
=IF(ROW()>COUNT($B:$B),"",INDEX(Sheet1!A:A,MATCH(SMALL($B:$B,ROW()),$B:$B,0)))

Copy C1 across to G1. Then select B1:G1, copy down to cover the max expected
extent of data in Sheet1. Hide away col B. Cols C to G will return all lines
from Sheet1 corresponding to the name input in A1, neatly bunched at the top.
 
G

Guest

Venturing an alternative interp ..

Assume source data in Sheet1, cols A to F from row1 down
where col F = names
(names listed may not be unique, may appear multiple times in col F)

Then in another sheet, if a single name will be input in A1
Put in B1:
=IF($A$1="","",IF($A$1=Sheet1!F1,ROW(),""))

Put in C1:
=IF(ROW()>COUNT($B:$B),"",INDEX(Sheet1!A:A,MATCH(SMALL($B:$B,ROW()),$B:$B,0)))

Copy C1 across to G1. Then select B1:G1, copy down to cover the max expected
extent of data in Sheet1. Hide away col B. Cols C to G will return all lines
from Sheet1 corresponding to the name input in A1, neatly bunched at the top.
 
M

Max

Sorry, just detected, there's a slight correction to the earlier:
=IF(A1="","",INDEX(Sheet1!A:A,MATCH($A1,Sheet1!$F:$F,0)))

it should have read as:
=IF($A1="","",INDEX(Sheet1!A:A,MATCH($A1,Sheet1!$F:$F,0)))

(Missed the "$" for the front IF's $A1)

Anyway, guess my other suggestion -- the alternative interp on your post --
names listed may not be unique, may appear multiple times in col F seems to
be what you were after.

---
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top