Do I need macro for this?

rahulbassi268

New Member
Joined
Sep 23, 2016
Messages
14
Hello All,

Please help me with below problem where I have multiple rows of data for each ID and I wish to have only 1 row for each ID.

Student IDStudent NameAcademic LoadTopicRelationshipRelative Name
100JamesFBlah Blah 1MotherCinthia
100JamesFBlah Blah 1FatherJohn
102RobertPBlah Blah 2BrotherJack
102RobertPBlah Blah 2FatherEric
102RobertPBlah Blah 2SisterJill
105JeremyPBlah Blah 3
106JakePBlah Blah 4FatherMaxwell
107GarryFBlah Blah 5Ashley


Below is the output I wish to see

Student IDStudent NameAcademic LoadTopicMotherFatherBrotherSisterUnknown
100JamesFBlah Blah 1CinthiaJohn
102RobertPBlah Blah 2EricJackJill
105JeremyPBlah Blah 3
106JakePBlah Blah 4Maxwell
107GarryFBlah Blah 5Ashley
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Maybe this way...adjust your ranges to suit
VBA Code:
 Sub MM1()
    Range("A2:F9").RemoveDuplicates (1)
End Sub
 
Upvote 0
@Peter_SSs advised you some time ago here to update your account details so helpers could see what version of Excel you are using - please do so.
I'm going to assume you have 365, and in answer to the question you posed in the post title, you could use this appraoch:
Sheet1:
Book1
ABCDEF
1Student IDStudent NameAcademic LoadTopicRelationshipRelative Name
2100JamesFBlah Blah 1MotherCinthia
3100JamesFBlah Blah 1FatherJohn
4102RobertPBlah Blah 2BrotherJack
5102RobertPBlah Blah 2FatherEric
6102RobertPBlah Blah 2SisterJill
7105JeremyPBlah Blah 3
8106JakePBlah Blah 4FatherMaxwell
9107GarryFBlah Blah 5Ashley
Sheet1


Sheet2:
Book1
ABCDEFGHI
1Student IDStudent NameAcademic LoadTopicMotherFatherBrotherSisterUnknown
2100JamesFBlah Blah 1CinthiaJohn   
3102RobertPBlah Blah 2 EricJackJill 
4105JeremyPBlah Blah 3     
5106JakePBlah Blah 4 Maxwell   
6107GarryFBlah Blah 5    Ashley
Sheet2
Cell Formulas
RangeFormula
A2:D6A2=UNIQUE(Sheet1!A2:D9)
E2:H6E2=XLOOKUP(1,(Sheet1!$A:$A=$A2)*(Sheet1!$E:$E=E$1),Sheet1!$F:$F,"")
I2:I6I2=IF(ISBLANK(XLOOKUP(1,(Sheet1!$A:$A=$A2)*(Sheet1!$E:$E=""),Sheet1!$F:$F,"")),"",XLOOKUP(1,(Sheet1!$A:$A=$A2)*(Sheet1!$E:$E=""),Sheet1!$F:$F,""))
Dynamic array formulas.
 
Upvote 0
@Peter_SSs advised you some time ago here to update your account details so helpers could see what version of Excel you are using - please do so.
I'm going to assume you have 365, and in answer to the question you posed in the post title, you could use this appraoch:
Sheet1:
Book1
ABCDEF
1Student IDStudent NameAcademic LoadTopicRelationshipRelative Name
2100JamesFBlah Blah 1MotherCinthia
3100JamesFBlah Blah 1FatherJohn
4102RobertPBlah Blah 2BrotherJack
5102RobertPBlah Blah 2FatherEric
6102RobertPBlah Blah 2SisterJill
7105JeremyPBlah Blah 3
8106JakePBlah Blah 4FatherMaxwell
9107GarryFBlah Blah 5Ashley
Sheet1


Sheet2:
Book1
ABCDEFGHI
1Student IDStudent NameAcademic LoadTopicMotherFatherBrotherSisterUnknown
2100JamesFBlah Blah 1CinthiaJohn   
3102RobertPBlah Blah 2 EricJackJill 
4105JeremyPBlah Blah 3     
5106JakePBlah Blah 4 Maxwell   
6107GarryFBlah Blah 5    Ashley
Sheet2
Cell Formulas
RangeFormula
A2:D6A2=UNIQUE(Sheet1!A2:D9)
E2:H6E2=XLOOKUP(1,(Sheet1!$A:$A=$A2)*(Sheet1!$E:$E=E$1),Sheet1!$F:$F,"")
I2:I6I2=IF(ISBLANK(XLOOKUP(1,(Sheet1!$A:$A=$A2)*(Sheet1!$E:$E=""),Sheet1!$F:$F,"")),"",XLOOKUP(1,(Sheet1!$A:$A=$A2)*(Sheet1!$E:$E=""),Sheet1!$F:$F,""))
Dynamic array formulas.
Thanks Kevin
This worked
 
Upvote 0
So can you please update your forum profile (click your user name at the top right of the forum, then ‘Account details’) so helpers always know what Excel version(s) & platform(s) you are using (like in my profile below) as the best solution often varies by version? (Don’t forget to scroll down & ‘Save’)

1702874353861.png
 
Upvote 0

Forum statistics

Threads
1,215,181
Messages
6,123,513
Members
449,101
Latest member
mgro123

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top