Character count on each line within one cell

ramesanscesse

New Member
Joined
Nov 20, 2024
Messages
17
Office Version
  1. 365
Platform
  1. Windows
Hi everyone!

I am desperately trying to find the right formula (can't be a macro or anything complicated like that) to count the amount of characters on each line within a cell.
I have been trying to find it for years, it's driving me nuts, so at long last, I worked up the courage to create an account and ask here, in hopes that you guys can help me put this matter to rest once and for all 🙏
Ideally, it's something that would display like this, in B2, once applied 👇 (and that could be dragged down to do the same for each additional text cell in the A column).

1732140775935.png


I used to have a supervisor at an old job who knew this formula, some 7 or 8 years ago, but I've changed companies since, and no one at my new company seems to know it even the higher-ups who are really good at Excel. And even my co-workers from my old company can't remember it either, we just know it was fairly lengthy. As you can imagine, I've tried googling it many times over the years, but since English isn't my first language and I am pretty much technologically illiterate (I'm joking ofc... but barely!), I haven't been able to find it, so I really hope I'll be able to get an answer here.
Many thanks in advance!

P.S.: if you're using technical terms, please explain them to me like you would to someone from the Middle Ages 😂
I'm very much a "Letters Over Computers"-type of person, haha!
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Edit- I suggest you post your sample data using XL2BB.
My guess the lines are separated by line breaks. Try:
Book2
AB
1
2Hello! I hope you have a nice day, today.6 0 34
Sheet3
Cell Formulas
RangeFormula
B2B2=TEXTJOIN(CHAR(10),,LEN(TEXTSPLIT(A2,CHAR(10))))
 
Upvote 0
Hi Cubist! Yes, it would basically be like the example I've provided on the screenshot : text that is spread on several lines within the same cell.
And then, there could be other cells in the same case on the other rows of the sheet, of course.
 
Upvote 0
Cribbing mainly from XOR XL, if there are only 3 entries (and remembering to wrap the cell)

Book1
AB
1Hello Have a nice day5 0 15
2This is a test Tested Again14 0 12
3Tested for The Last time10 3 9
Sheet8
Cell Formulas
RangeFormula
B1:B3B1=LEN(TRIM(MID(SUBSTITUTE($A1,CHAR(10),REPT(" ",999)),999*(ROWS($1:$1)-1)+1,999))) & CHAR(10) & LEN(TRIM(MID(SUBSTITUTE($A1,CHAR(10),REPT(" ",999)),999*(ROWS($1:$2)-1)+1,999)))&CHAR(10) &LEN(TRIM(MID(SUBSTITUTE($A1,CHAR(10),REPT(" ",999)),999*(ROWS($1:$3)-1)+1,999)))
 
Upvote 0
Oh, I just saw your edit!
Thanks for the answer, I'm not sure what this XL2BB thing is, but from the link you posted, it looks extremely complicated ><

I'm looking for a formula that I can use offline by simply copy-pasting it in Excel, without the need of external tools.
 
Upvote 0
I can use offline by simply copy-pasting it in Excel

Click the
1732143550605.png
Symbol in the XL2BB screenshot either I or @Cubist posted, click A1 in your Excel Sheet and press Ctrl + V

Might be worth reading the links below ;)


 
Last edited:
Upvote 0
I'm a little confused how Cubist's solution did not help. Is this not for Excel 365?
 
Upvote 0
I'm a little confused how Cubist's solution did not help. Is this not for Excel 365?
My 1st post was because I missed @Cubist edit (probably didn't refresh the screen), I don't think the OP knew how to copy from XL2BB
 
Upvote 0
Hi MARK858, thank you for your reply and for the links.
Unfortunately, I am not able to download any external file on this computer (and I don't have one of my own), so I can't install the tool you guys are talking about, hence the screenshot.

But I did copy-paste what you posted into Excel, and while it works well for the sample you provided, if I add a fourth line in A1, for example, then it doesn't work anymore. IIRC, the formula we were using at my old company worked regardless of the amount of lines that the cell contained, I think (but it's been so long tbh, I could be mistaken).
 
Upvote 0
Hi MARK858, thank you for your reply and for the links.
Unfortunately, I am not able to download any external file on this computer (and I don't have one of my own), so I can't install the tool you guys are talking about, hence the screenshot.

But I did copy-paste what you posted into Excel, and while it works well for the sample you provided, if I add a fourth line in A1, for example, then it doesn't work anymore. IIRC, the formula we were using at my old company worked regardless of the amount of lines that the cell contained, I think (but it's been so long tbh, I could be mistaken).
Did you test the formula @Cubist posted (see below)?

Book1
AB
2Hello! I hope you have a nice day, today. Dfffff mmmm jjj kklojk hjklug 6 0 34 11 10 0 6 0
Sheet9
Cell Formulas
RangeFormula
B2B2=TEXTJOIN(CHAR(10),,LEN(TEXTSPLIT(A2,CHAR(10))))
 
Upvote 0

Forum statistics

Threads
1,225,730
Messages
6,186,698
Members
453,369
Latest member
positivemind

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top