Home > Back-end >  Summarize two numbers from one cell separately in Google Sheets
Summarize two numbers from one cell separately in Google Sheets

Time:07-26

I have multiple cells that each contain two numbers separated by a "/"

For example:

A1 = 10/2
A2 = 5/4
A3 = 8/1
A4 = 13/1

in A5, I would like to summarize everything on the left side of the "/" and on the right side of the "/". So A5 should have the output: 36/8

How do I do this?

Thanks in advance!

CodePudding user response:

Try below formula-

=SUM(INDEX(SPLIT(A1:A4,"/"),,1)) & "/" & SUM(INDEX(SPLIT(A1:A4,"/"),,2))

Also can try-

=JOIN("/",QUERY(INDEX(SPLIT(A1:A4,"/")),"select sum(Col1), sum(Col2) label sum(Col1) '', sum(Col2) ''"))

CodePudding user response:

try:

=INDEX(JOIN("/", MMULT(TRANSPOSE(SPLIT(A1:A4, "/")), {1;1;1;1})))

enter image description here

CodePudding user response:

Alternatively:

enter image description here

Formula in B1:

=JOIN("/",INDEX(QUERY(SPLIT(A1:A4,"/"),"select Sum(Col1), Sum(Col2)"),2))
  • Related