How to combine few rows data into 1

EugeneTan79

New Member
Joined
Apr 10, 2018
Messages
2
Hi,
Anyone is able to help me to combine the different rows data into 1 row. I have data that are show in the first 5 rows. What formula should I use so that I am able to combine the data into the last row. Tks

IndexNameNRICClassELMACLMLTLHU
1552JohnS12344-22
1552JohnS12344-24
1552JohnS12344-25
1552JohnS12344-23
1552JohnS12344-22453

<tbody>
</tbody>


<colgroup><col><col><col><col span="8"><col></colgroup><tbody>
</tbody>
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
so do you want a formula to give the last row in your table ?

IndexNameNRICClassELMACLMLTLHU
1552JohnS123404-Feb2
1552JohnS123404-Feb 4
1552JohnS123404-Feb 5
1552JohnS123404-Feb 3
7777bobs765404-Feb4
7777bobs765404-Feb5
7777bobs765404-Feb3
7777bobs765404-Feb
ELMACLMLTLHU
1552JohnS123404-Feb245003
7777bobs765404-Feb040530
the 2 under EL obtained by
=SUMPRODUCT(($B$2:$B$8=$B12)*(E$2:E$8))
easy to suppress the 0's if you need to

<colgroup><col width="64" span="11" style="width:48pt"> </colgroup><tbody>
</tbody>
 
Upvote 0
Hi,

As you didn't specify the criterion for the results, here are 2 examples:


Excel 2010
ABCDEFGHIJ
1IndexNameNRICClassELMACLMLTLHU
21552JohnS12342-Apr2
31552JohnS12342-Apr4
41552JohnS12342-Apr5
51552JohnS12342-Apr3
61552JohnS12342-Apr2453
7
8IndexNameNRICClassELMACLMLTLHU
91552JohnS12342-Apr2
101552JohnS12342-Apr4
111552JohnS12342-Apr5
121552JohnS12342-Apr3
131552JohnS12342-Apr2453
Sheet1
Cell Formulas
RangeFormula
E6=IF(SUM(E$2:E$5)=0,"",SUM(E$2:E$5))
E13=IF(SUMIFS(E$9:E$12,$A9:$A12,$A13,$B9:$B12,$B13,$C9:$C12,$C13,$D9:$D12,$D13)=0,"",SUMIFS(E$9:E$12,$A9:$A12,$A13,$B9:$B12,$B13,$C9:$C12,$C13,$D9:$D12,$D13))


Formulas copied across.
D6 formula if it's a simple sum.
D13 formula if Index, Name, NRIC, Class has to match.
 
Last edited:
Upvote 0
Hi,

Sorry. Let me repost my question again. I have more than 100 students taking the different subjects and different students will take different number of subjects. I am now just using 2 students as example. How am I able to get the output at the last 2 rows. Really appreciate the help

Index
Name
NRIC
Class
EL
MA
CL
ML
TL
HU
1552
John
S1234
4-2
2





1552
John
S1234
4-2

4




1552
John
S1234
4-2


5



1552
John
S1234
4-2





3
7777
bob
S7654
4-2

4




7777
bob
S7654
4-2



5


7777
bob
S7654
4-2




3











1552
John
S1234
4-2
2
4
5


3
7777
Bob
S7654
4-2

4

5
3


<tbody>
</tbody>
 
Upvote 0
Welcome to the MrExcel board!

See if this would work for you.

Formula in A12 is copied down
Formula in B12 is copied across to column D and down
Formula in E12 is copied across to column J and down

Excel Workbook
ABCDEFGHIJ
1IndexNameNRICClassELMACLMLTLHU
21552JohnS12344-22
31552JohnS12344-24
41552JohnS12344-25
51552JohnS12344-23
67777bobS76544-24
77777bobS76544-25
87777bobS76544-23
9
10
11IndexNameNRICClassELMACLMLTLHU
121552JohnS12344-2245003
137777bobS76544-2040530
14
Sheet3



If you don't want the '0' values in columns E:J you could either
- custom format those columns as 0;0;
or
- change the E2 formula to =IF($A12="","",IF(SUMIF($A$2:$A$8,$A12,E$2:E$8),SUMIF($A$2:$A$8,$A12,E$2:E$8),""))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,929
Messages
6,122,315
Members
449,081
Latest member
tanurai

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