Dimension Formulae for Iterated Function Systems