Replicate Stata Tab function in Excel?

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!
 

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.

Forum statistics

Threads
1,223,236
Messages
6,170,906
Members
452,366
Latest member
TePunaBloke

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