Check if cell has given tag. Great for formula-based conditional formatting.
Syntax: \HAS.TAG(tag_text, [reference]) => logical
=LAMBDA(tag,[reference],
LET(
txt, IF(ISOMITTED(reference),INDIRECT("RC",0),reference),
ct, UNICHAR(917631),
tags, IF(RIGHT(txt,1)=ct,
LET(
ts, TEXTSPLIT(txt,ct,,1) & ct,
MAP(ts, LAMBDA(x,
REDUCE("",SEQUENCE(LEN(x)),LAMBDA(acc,val,
LET(
v, RIGHT(LEFT(x,val),1),
c, IF(v<>"",UNICODE(v),0),
acc & IF(AND(c>917535,c<917631),UNICHAR(c-917504),"")
)
))
))
)
),
SUM(INT(TEXT(tag,"0")=tags))>0
)
)
Documentation
Checks if the current cell or cell passed in the reference contains a tag equal to tag_text.
If reference is passed, it checks the cell from the reference. If reference is omitted, checks the cell in which the formula resides (for use in conditional formatting rules manager).
Usage of the \HAS.TAG function in the worksheet with the reference argument omitted will result in circular references.
The function will only return true if there is a tag appended to the end of the cell value. It does not have to be the tag that is being checked for.