Check out example codes for "sum by name in google sheets". It will help you in understanding the concepts better.

Code Example 1

=SUM(FILTER($B$2:B;$A$2:A="VALUE YOU WANT TO GROUP BY"))

Learn ReactJs, React Native from akashmittal.com