ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Copying data based on a condition (https://www.excelbanter.com/excel-worksheet-functions/113051-copying-data-based-condition.html)

aheintz57

Copying data based on a condition
 
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).


Max

Copying data based on a condition
 
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.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"aheintz57" wrote:
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).


Max

Copying data based on a condition
 
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(S MALL($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.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"aheintz57" wrote:
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).


Max

Copying data based on a condition
 
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(S MALL($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.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"aheintz57" wrote:
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).


Max

Copying data based on a condition
 
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.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---




All times are GMT +1. The time now is 11:27 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com