In this paper we prove a multifractal formalism of Birkhoff averages for interval maps with countably many branches. Furthermore, we prove that under certain assumptions the Birkhoff spectrum is real analytic. We also show that new phenomena occur; indeed, the spectrum can be constant or it can have points where it is not analytic. Conditions for these to happen are obtained. Applications of these results to number theory are also given. Finally, we compute the Hausdorff dimension of the set of points for which the Birkhoff average is infinite.