Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Excel SUM parts of a string

in Excel I have a few cells containing numbers sperated bij a dash, like:

Example

I use a formula like

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

=TRIM(TEKSTBEFORE(G30:G40;"/";1))

>Solution :

Try using TEXTSPLIT()

enter image description here


• Formula used in cell B1

=SUM(--TEXTSPLIT(A1," / "))

Or,

enter image description here


=MAP(A1:A7,LAMBDA(φ, SUM(--TEXTSPLIT(φ," / "))))

Edit: As OP Commented:

Sorry, I think I’m not clear enough. I have to sum all first values,
all second values and all thirth values separately. In this example
the result would be 4 / 98 / 0. That would be the end result. Thanks
for the reply b.t.w


enter image description here


• Formula used in cell B1

=TEXTJOIN(" / ",,BYCOL(TEXTSPLIT(TEXTAFTER(" / "&A1:A7," / ",{1,2,3})," / "),LAMBDA(α, SUM(--α))))

Also in **Excel Beta Version you can use GROUPBY()

enter image description here


=GROUPBY(,--TEXTSPLIT(TEXTAFTER(" / "&A1:A9," / ",{1,2,3})," / "),SUM)

Or using PIVOTBY()

enter image description here


=PIVOTBY(,,--TEXTSPLIT(TEXTAFTER(" / "&A1:A9," / ",{1,2,3})," / "),SUM)

To know more on the New Launched function in Beta Versions of Windows Excel & Mac can be found here:

  • GROUPBY() –> MSFT Documentations
  • PIVOTBY() –> MSFT Documentations

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading