Reputation: 5345
I have the following cells with emojis.
As you can see I would like to get the value of these emojis as numeric.
I tried using a regex: =len(regexreplace(A2,"[^\⭐️]",""))
However, I do not get the desired result.
Any suggestions what I am doing wrong? Find below the link to the example spreadsheet:
Link to the Example Spreadsheet
I appreciate your replies!
Upvotes: 0
Views: 57
Reputation: 29939
added formula to your sheet. Please test it out:
=MAKEARRAY(COUNTA(A2:A),1,LAMBDA(r,c,LAMBDA(ax,IF(ax=0,"-",ax))(LEN(REGEXREPLACE(INDEX(A2:A,r),"[^⭐]",""))+ LEN(REGEXREPLACE(INDEX(A2:A,r),"[^💥½¾]",""))/2)))
ALTERNATE FORMULA
=BYROW(IFERROR(INDEX(SPLIT(REGEXREPLACE(A2:A, "(.)", "$1|"), "|"))),LAMBDA(ax,IF(ax="",,LAMBDA(zx,IF(zx=0,"-",zx))(COUNTIF(ax,"⭐")+COUNTIF(ax,"💥")+IF((COUNTIF(ax,"½")>0)+(COUNTIF(ax,"¾")>0),0.5,)))))
-
Upvotes: 2