This is a kind of task (call it "do-Excel-in-Tableau")
I would not recommend doing in Tableau, anyway...
But as just another exercise in Table Calculations,
please find the attached. No Grand Totals, sorry,
as they're not what you'd like them to be.
Grid_Calc_YF.twbx 73.0 KB