More complicated designs: For situations comparing more than two groups (where analysis of variance will be the technique of analysis), the simplest (and justifiable) approach is to focus on the two groups you are most interested in being able to compare and then use the two-sample formulas above.
For repeated measures designs with more than two measurements per subject, once again, focus on the two measurements of most interest (e.g. baseline and final follow-up) and use the formula for paired measurements.
For categoric data with more than two rows and/or more than two columns, analysis is usually based on chi-squared tests. Sample size procedures are not worked out for these situations. Instead, find the two key groups to be compared, collapse the outcome to binary, and use the procedures for comparing two proportions. Note also that from theoretical considerations, a chi-square test of independence requires at least five observations per cell to give fully valid results, so plan accordingly. That is, find the key crosstabulation, determine the number of rows and columns (i.e. the number of levels of the two variables), compute the number of cells and then multiply by 5; that should be the minimum sample size for this situation.