Salih
Salih

Reputation: 381

How do I count occurrence of a text within a cell in Google Sheets?

The question seems too straight forward that it can be answered by a simple google search (OR A SIMPLE FORMULA), but I neither found a single question nor a doc explaining this.

The cells in question contains multiple URLs separated by new line (enter key). Note, the below values are in a single cell.

https://stackoverflow.com/questions

https://stackoverflow.com/jobs

I'm trying to find a forumla that says how many "https" are there in each cell of a column. I tried COUNTIF and COUNTA but its not giving the correct answer.

Upvotes: 0

Views: 299

Answers (1)

Rocky
Rocky

Reputation: 990

Try the below formula:

=Countif(Transpose(SPLIT(Trim(REGEXREPLACE(A1,"//\S+","")),":")),"*")

Change cell reference per your need.

Upvotes: 3

Related Questions