Count number of non-empty lines in a multiline cell

ch1zra

New Member
Joined
Nov 3, 2016
Messages
8
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
Hello everyone,

I am having trouble with one of the sheets at work that is created and maintained in quite a bad manner.
It contains multiline cells but not all lines are containing text, some are just plan char(10).
What I need is a way to count number of lines that are non-empty.
I can get number of total lines using
Code:
=(LEN(A1)-LEN(SUBSTITUTE(A1,CHAR(10),"")))+1
but I am stuck on how to continue...
 

Attachments

  • xcl.png
    xcl.png
    11.8 KB · Views: 9
It is working, I have been counting empty lines instead of non-empties.
I guess only 3 hours of sleep in 40s is not the same as in 20s :D
Apologies for the mistake and once again huge thanks for the solution.
 
Upvote 0

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,221,417
Messages
6,159,789
Members
451,589
Latest member
Harold14

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