Suppose, we have cells as below:
Cell Value Legend
==========================
A1 1,A // A = 1
A2 2,AA // AA = 2
A3 3,L // L = -1
A4 4,N // N = 0
I want the total to be calculated separately in other cells as:
A5 = SUM(1, 2, 3, 4) = 1 2 3 4 = 10
A6 = SUM(1*A, 2*AA, 3*L, 4*N) = 1 4 - 3 0 = 2
Considering it may require separate functions in App Script, I tried to use SPLIT and SUM them, but it's not accepting the values. I asked a related question: 
and for the last
=sum(ArrayFormula(iferror(regexextract(A1:A4; "\d ")*vlookup(regexextract(A1:A4; "[^,] $");D1:E4; 2; 0 ))))

