You could use VBA to inspect each cell involved and set its formatting based
on its value.
Record a macro of yourself setting the various custom formats. You'll see
statements like
Selection.NumberFormat =
"[>=10000000]#\,##\,##\,##0;[>=100000]##\,##\,##0;##,##0"
i.e. the format specifier is simply a string. So, you could grab the
worksheet change event and buzz around your cells, determining what format
they should be and changing them when necessary. (You probably should avoid
changing a cell's format to what it is already - it might slow things down.
Just check the current format against what you think it should be and change
it if it doesn't match.)