Items in a comma list
A Google Sheets formula exercise from Sheetsdrill. Solve it with a formula bar on a live sheet in your browser, and it is checked the moment you submit.
The task
Each row holds a comma-separated list of tags with no spaces. Count how many tags are on each row: the number of commas plus one. Use LEN and SUBSTITUTE, and fill B2 and B3.
What this exercise teaches
There is no COUNTCHAR function, so the length difference is the standard way to count a character. COUNTA(SPLIT(A2, ",")) gives the same answer and is easier to read, at the cost of building an array.
A hint if you get stuck
SUBSTITUTE(A2, ",", "") removes every comma. The length before minus the length after is the number of commas.
Try it now, free, no account needed
The first 15 tasks on Sheetsdrill are free. Open it on the practice page, solve it, and get instant feedback with a hint. A free account adds the worked solution; Pro adds timed mode and the certificate.
Open this exerciseMore exercises in Text and dates
- First name with SPLITPro
- Join the confirmed namesPro
- Address without gapsPro
- Valid order IDsPro
- Pull out the invoice numberPro
- Digits onlyPro
- Month label with TEXTPro
- Full years of servicePro
- Working days with holidaysPro
- Due at the end of next monthPro
- Tidy up pasted namesPro
- Domain of an email addressPro
- Renewal date with EDATEPro
- Orders placed at the weekendPro
- Amount inside a sentencePro