Add function to get element counts out of a formula