Count number of spaces in a range
This tutorial shows how to count the number of spaces in a range using an Excel formula, with the SUMPRODUCT, LEN and SUBSTITUTE functions
=SUMPRODUCT(LEN(B5:B7)-LEN(SUBSTITUTE(B5:B7," ","")))
|
GENERIC FORMULA
=SUMPRODUCT(LEN(range)-LEN(SUBSTITUTE(range," ","")))
ARGUMENTS EXPLANATION |
RELATED TOPICS
Related Topic | Description | Related Topic and Description |
---|---|---|
Count number of spaces in a string | How to count the number of spaces in a string | |
Count number of line breaks in a cell | How to count the number of line breaks in a cell |
RELATED FUNCTIONS
Related Functions | Description | Related Functions and Description |
---|---|---|
SUBSTITUTE Function | The Excel SUBSTITUTE function replaces characters with another in a specified string | |
LEN Function | The Excel LEN function returns the number of characters in a specified string | |
SUMPRODUCT Function | The Excel SUMPRODUCT function multiplies corresponding ranges and returns the sum of these values |