Character count on each line within one cell

ramesanscesse

New Member
Joined
Nov 20, 2024
Messages
9
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!
 
AFAIK Its not possible for conditional formatting to format part of a cell
The way I read col H in the image, that is not being asked for.

1732159629074.png


Also note that in the image some cells in col C have multiple values.

@ramesanscesse
In relation to my last sentence above, where a cell in column C has multiple values. In your image those cells have the same number (7) on each line within the cell. Is that always the case or could they be different like rows 8 & 9 in my example below?
Also, could the number of values in column C be different to the number of lines in column F (& column G)?

Anyway, this is my suggestion for the layout given

ramesanscesse.xlsm
CDEFG
1
210Mana Potion11
310HP Potion9
410 
510Shield6
67 7Evil begone4 6
77 7verybiglongtextononeline short24 5
83 5two three3 5
93 5four three4 5
Sheet1
Cell Formulas
RangeFormula
G2:G9G2=IF(F2="","",TEXTJOIN(CHAR(10),,LEN(TEXTSPLIT(F2,CHAR(10)))))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
G2:G9Expression=MAX(TEXTSPLIT(G2,CHAR(10))-TEXTSPLIT(C2,CHAR(10)))>0textNO
 
Upvote 0

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
You can try this.
Book2
ABC
1TextMax AllowedText Count
2Hello! Hi I hope you have a nice day, today.7 3 506 2 34
3Today is a beautiful day1 8 1 25 2 1 13
Sheet3
Cell Formulas
RangeFormula
C2:C3C2=TEXTJOIN(CHAR(10),,LEN(TEXTSPLIT(A2,CHAR(10))))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C2:C3Expression=SUM(--(LEN(TEXTSPLIT(A2,CHAR(10)))>--TEXTSPLIT(B2,CHAR(10))))>0textNO
 
Upvote 0
If it is not then there already a few posts (including my last 2) where the entire cell is highlighted
I didn't understand how the data in post #18 relates to the data/layout in the post #19 image but the post #20 CF does not work for me with the post #19 layout (G6 is not highlighted like in the image provided). Did I not apply it correctly?

ramesanscesse.xlsm
CDEFG
1
210Mana Potion11
310HP Potion9
410Shield6
57 7Evil begone4 6
67 7verybiglongtextononeline short24 5
Sheet2
Cell Formulas
RangeFormula
G2:G6G2=IF(F2="","",TEXTJOIN(CHAR(10),,LEN(TEXTSPLIT(F2,CHAR(10)))))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
G2:G6Expression=SUM(--(LEN(TEXTSPLIT(F2,CHAR(10)))>C2))textNO
 
Upvote 0

Forum statistics

Threads
1,223,837
Messages
6,174,927
Members
452,593
Latest member
Jason5710

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