There are three source of variations. They are total variation, within subgroup variation, and between subgroup variation. The first two are used in capability analysis, whereas the last one will not be used and it is expected to be zero (ideal case).
The total variation (overall) can be determined by the normal way, whereas the within variation needs to be estimated.
Normally, the data should be collected 4-5 data per subgroup and the total subgroups should be at 20-25 subgroups