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

multiline cell: sum the second line of each cell

I need to sum the second line of every cell from a range.

  • Every line is separated by char(10)
  • Some cells doesn’t have 1st, 2nd or 3rd line

I’ve tried to split and index 2nd row, I’m capable for 1 cell but not for the entire range.

enter image description here

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

>Solution :

You can try with this formula that SPLITs the values by CHAR(10), with INDEX grabs the second value. With BYCOL repeats the process for each of the three columns. SUMs them, and finally repeats the process for each row with BYROW:

=BYROW(B2:D,LAMBDA(r,IF(COUNTA(r)=0,,
SUM(BYCOL(r,LAMBDA(each,INDEX(SPLIT(each,CHAR(10),1,0),,2)))))))

enter image description here

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