If you're doing this to display in Excel then I wouldn't bother putting the thousand separators in at all. Just spit out the numbers, and let Excel handle the...
But if, as you said, the data in the second table is data that was missing from the first table, there won't be any duplicates. Unless I'm missing something else,...