My spreadsheet looks like this:
Is there a way with a formula to get in the B row the number of lines (including line breaks) as you see in the picture below?
Given your example setup:
=ArrayFormula(IF(A:A="",,LEN(A:A)-LEN(SUBSTITUTE(A:A,CHAR(10),""))+1))
To be clear, this counts number of lines, not number of line breaks. One line has zero line breaks. Two lines has one line break, etc.
This formula starts with the full length of each cell's contents (including line breaks) and then subtracts the length of each cell without those line breaks. That gives the total number of line breaks present, to which we add 1 to get the total number of lines.
Thank you for this formula it's great!
Now, I also want to use the same scenario above, where a cell has multiple values within it, and I need to find the duplicates in a column that has multiple line breaks in each cell, is there a way to do this?