akswartz85
New Member
- Joined
- Mar 31, 2010
- Messages
- 49
Hello - I'm trying to replicate the Stata "tab" function in excel. I have a spreadsheet where I'd like to understand the number of times a set of trainings have been requested, by a person's stage (A->E). I'd then like to be able to filter by a person's demographics (ethnicity, gender, and so on).
Pivot tables are OK when just comparing two things (one training and stage) but I've got about 100 different trainings to go through. I'd like to have one summary table. The stata "tab" function will do just that for me.
At the end of the day, my table would look something like this:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD](ALL RECORDS)[/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]training 1[/TD]
[TD]4[/TD]
[TD]3[/TD]
[TD]1[/TD]
[TD]6[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]training 2[/TD]
[TD]3[/TD]
[TD]2[/TD]
[TD]8[/TD]
[TD]23[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]training 3[/TD]
[TD]13[/TD]
[TD]2[/TD]
[TD]43[/TD]
[TD]12[/TD]
[TD]15[/TD]
[/TR]
[TR]
[TD]training 4[/TD]
[TD]12[/TD]
[TD]16[/TD]
[TD]6[/TD]
[TD]8[/TD]
[TD]2[/TD]
[/TR]
</tbody>[/TABLE]
With an option to add a filter: [TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD](All and Male v. Female)[/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]training 1 (All)[/TD]
[TD]4[/TD]
[TD]3[/TD]
[TD]1[/TD]
[TD]6[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD] training 1 (male)[/TD]
[TD]3[/TD]
[TD]1[/TD]
[TD]0[/TD]
[TD]3[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD] training 1 (female)[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]1[/TD]
[TD]3[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]training 2 (all)[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
... And so on.
Is this possible to do? Wishing I had Stata right now!
Pivot tables are OK when just comparing two things (one training and stage) but I've got about 100 different trainings to go through. I'd like to have one summary table. The stata "tab" function will do just that for me.
At the end of the day, my table would look something like this:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD](ALL RECORDS)[/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]training 1[/TD]
[TD]4[/TD]
[TD]3[/TD]
[TD]1[/TD]
[TD]6[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]training 2[/TD]
[TD]3[/TD]
[TD]2[/TD]
[TD]8[/TD]
[TD]23[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]training 3[/TD]
[TD]13[/TD]
[TD]2[/TD]
[TD]43[/TD]
[TD]12[/TD]
[TD]15[/TD]
[/TR]
[TR]
[TD]training 4[/TD]
[TD]12[/TD]
[TD]16[/TD]
[TD]6[/TD]
[TD]8[/TD]
[TD]2[/TD]
[/TR]
</tbody>[/TABLE]
With an option to add a filter: [TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD](All and Male v. Female)[/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]training 1 (All)[/TD]
[TD]4[/TD]
[TD]3[/TD]
[TD]1[/TD]
[TD]6[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD] training 1 (male)[/TD]
[TD]3[/TD]
[TD]1[/TD]
[TD]0[/TD]
[TD]3[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD] training 1 (female)[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]1[/TD]
[TD]3[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]training 2 (all)[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
... And so on.
Is this possible to do? Wishing I had Stata right now!