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

How to perform calculations on numbers stored as text in google sheets or excel?

enter image description here

Here numbers are stored as a list as text. There can be 1 to 20 numbers in the list. Need to minus 1st number in list A with 1st number in list B and store it List C as a text.

Get list of difference of numbers

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 :

Try using MAP() function in Excel

enter image description here


• Formula used in cell G2

=MAP(C2,E2,LAMBDA(a,b,
 LET(c, TEXTSPLIT(a,,CHAR(10)), 
     d, TEXTSPLIT(b,,CHAR(10)), 
     TEXTJOIN(CHAR(10),,c-d))))

Don’t forget to wrap the cells by hitting ALT+H+W


In Google Sheets:

enter image description here


=MAP(C2,E2,LAMBDA(a,b,
 LET(c, SPLIT(a,CHAR(10)), 
 d, SPLIT(b,CHAR(10)), 
 ARRAYFORMULA(JOIN(CHAR(10),c-d)))))

Edit: LAMBDA() helper function is not needed:

=TEXTJOIN(CHAR(10),,TEXTSPLIT(C2,,CHAR(10))-TEXTSPLIT(E2,,CHAR(10)))

In Google Sheets also LAMBDA() helper is not needed:

=JOIN(CHAR(10),ARRAYFORMULA(SPLIT(C2,CHAR(10))-SPLIT(E2,CHAR(10))))

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