Adding grand total for columns

Hello community,

I am looking to add a grand total as an additional column and hoping someone can help.

I have four columns namely A, B , C & D. I want to sum all the rows horizontally and have created a new column called G. Now I also see I can achieve this by Math formula node but there is an issue because my column names are created by rule engine.

So C column can be absent in the next month because the data is not present and that would fail the math node because there is no Column C. Is there a way to handle this ?

Thanks,

R