Formula-driven table generation