Do you know beforehand what the maximum total might get up to (ie, how many thousands-sep commas you might need to insert)?
If less than 1 million - ie you only need at most one separator - try this:
thousands-sep.xlsx (11.4 KB)
(if you potentially need multiple separators for much larger multi-million numbers, then the general idea can be extended further; it just gets more messy... )