Excel Version: Microsoft 365 bundle (V 2106 Build: 14131.20278)
I'm trying to create an Excel formula that outputs a number onto a single cell (B11); the formula must:
- Count the number of cells that HAVE DATA on a given range [B2:B8];
- Therefore, IT must NOT count non-blank cells; but must also NOT INCLUDE cells with a specific string (in this case the string would be "N/A") ;
- The formula must also count the number of line breaks [so Char(10)] present on that given range.
I understand that it's not conventional to count inputted line breaks for a range; but that's what I need.
See the attached image:

RANGE = In this example, the range of (non-blank AND non-"N/A") cells I want to count go from B2 to B8.
Cell w/ Formula: B11
As of now, I only have the following formula done.
=SUM(LEN(B2:B8)-LEN(B2:B8;CHAR(10);""))+(LEN(B2:B8)>0))
This formula outputs == "9" (i.e., 9 line breaks: ignores blanks, but includes the string "N/A")
This formula allows me to count all line breaks present on that given range (so, it doesn't count blank/empty cells), but it obviously doesn't exclude the specific string "N/A".
Expected output == "8" (i.e., 8 line breaks: ignoring blank cells AND cells with the string "N/A")
I suppose this could be accomplished with an "IF", but I haven't figured it out yet.
Thank you for your time!
PS: I tried to make a table in here, but I was not able to add line breaks inside a single cell; so, I ended up resorting to an image to explain my point, sorry about the inconvenience!)