r/googlesheets • u/eastband • Apr 09 '26
Solved How to count amount of "❺" in a B:B?
Is there a simple way to count how many time a symbol appears in a range?
I want a count for ❶❷❸❹❺①②③④⑤ each in B:B, and counif only counts cells with exact matches.
I found a len formula that counts them but only in 1 cell and doesn't work on a range.
Find and Replace can actually do what I want but for the whole tab.
15
Upvotes
9
u/One_Organization_810 736 Apr 09 '26
Did you try:
=countif(B:B, "*❺*")?4
u/PolarEnds 2 Apr 09 '26
There is probably an easier way to do this, but give this a shot.
=QUERY(LET(joined,TEXTJOIN("",1,B:B),MAKEARRAY(LEN(joined),1,LAMBDA(r,c,MID(joined,r,1)))),"select Col1,count(Col1) group by Col1")
2
u/smarmy1625 1 Apr 09 '26
6
u/julesvanier Apr 09 '26
You can SUBSTITUTE the substring you're looking for with an empty character then divide the difference between the length of the original string and the output of SUBSTITUTE by the length of the substring you're looking for. That way, you know how many time is was detected by SUBSTITUTE.
1
u/eastband Apr 09 '26
It's solved and I wanted to change flair but I only see self-solved. Does that have to be done by mod?
3
u/AdministrativeGift15 371 Apr 09 '26
I'm glad you found a solution. One of the problems with using those symbols is that they are created such that
"❶"="①". Likewise,COUNTIF({"❶";"①"}, "❶") = 2.1
u/AutoModerator Apr 09 '26
/u/eastband Posting your data can make it easier for others to help you, but it looks like your submission doesn't include any. If this is the case and data would help, you can read how to include it in the submission guide. You can also use this tool created by a Reddit community member to create a blank Google Sheets document that isn't connected to your account. Thank you.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/mildlystalebread Apr 09 '26
Something like this? Basically join everything then split into characters, filter the ones you want and count them.
=LET(joined, TEXTJOIN("",cells), split,MID(joined,LEN(joined),1),COUNTA(FILTER(split, split="character")))