Sheetsdrill

Level 5: Text and dates Exercise 64 of 68 Pro

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.

Functions used: LEN, SUBSTITUTE

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 exercise

More exercises in Text and dates