Estimate cupcakes per guest.
Cupcake quantity starts from guests times a per-guest allowance, adds a margin for the ones that break, sink or get eaten during decorating, then rounds up to whole batches — because a tin makes twelve whether you need eleven or twelve. The as-baked figures matter more than the requirement: rounding to batches usually leaves surplus, and knowing the real per-guest number tells you whether to plan a second flavour or scale the allowance down.
Requirement
Cupcakes needed = ceiling(guests x cupcakes per guest x (1 + spare allowance))
Batches
Batches = ceiling(cupcakes needed / batch yield); baked = batches x batch yield
One and a half is a good default where cupcakes are the main sweet item, one where there is also a cake, and two or more for children's parties or where guests take one home.
Undecorated cupcakes freeze well for up to three months and thaw in about an hour, so batches can be spread across days. Buttercream is better made fresh, since refrigeration firms it and it needs re-whipping.