Making a table of data based on conditions

excel_321

New Member
Joined
Jul 14, 2014
Messages
36
Dear all,

I require a formula for the following problem. On Sheet 1 I have a set of data which consists of a list of employees with a column stating which department they are in (either A or B). It appears like this:

NameDepartment
JohnA
MikeA
SandraB
HarryB
RobB
JackieA
HelenB
MinnieA
KeeleyB
SavannaB
TerryA
SallyA
BobA
RexB
TomB
AngelA
BrookB
BartB
RonA
FelixA
MelanieB
KeriA
CaitlinA
JoanB
SamA
AaronA

<colgroup><col><col></colgroup><tbody>
</tbody>


On Sheet 2 I require two separate tables, one for employees from department A and the other for employees in department B. In each table the employees will be separated into 4 groups and need to be picked from the data on sheet 1 in the order in which they appear. The group sizes will vary and sometimes I will need to change the size of each one so I am looking for a formula which can automatically adjust the sizes of groups to the numbers I require. It is important that the names appear in the order they appear in the original data on sheet 1. An example of what the tables should look like is as follows.

For department A:

Group size 5324
Department A
Group 1Group 2Group 3Group 4
JohnSally RonKeri
MikeBobFelixCaitlin
JackieAngelSam
MinnieAaron
Terry

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

and for department B:

Group size 4323
Department B
Group 1Group 2Group 3Group 4
SandraKeeleyTomBart
HarrySavannaBrookMelanie
RobRexJoan
Helen

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


Please help!
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

Forum statistics

Threads
1,222,043
Messages
6,163,561
Members
451,844
Latest member
ddnndd1234

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