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

Extracting & summing data from a single cell in excel

I am trying to isolate some data contained within a cell in excel:

enter image description here

The idea is to add up all numbers before the "-" in the notes column. The data must all be contained within the same cell, as there are hundreds of lines on the full spreadsheet.

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

I.e. 4.3+0.8+4…

The amount of lines in the "Notes" cells will vary.

I tried using =TEXTBEFORE as below:
=TEXTBEFORE((NOTES CELL),"-",1)
and summing multiple TEXTBEFORE functions, but it becomes very messy with multiple lines inside the cell & needs to be adjusted based on how many lines are inside the cell.

I think I’m having an issue with the fact there is data inside the cell that I need to ignore (the 295### number).

Is this achievable?

>Solution :

Try using the following formula:

enter image description here


=SUM(--TEXTBEFORE(TEXTSPLIT(A1,CHAR(10)),"-"))

Or,

=SUM(--TAKE(TEXTSPLIT(A1,"-",CHAR(10)),,1))

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