0

I have here an Excel file that checks the presence of:

long hyphen (–)
curly apostrophe (’)
ï (e.g., naïve)
Non-breaking hyphen (‑)

Screenshot 1

Screenshot 1

Screenshot 2

Screenshot 2

Cell formula after each header above from Q to T (6th row):

long hyphen (–)
=IFERROR(TRANSPOSE(TEXTSPLIT(TEXTJOIN(", ", TRUE, IF(ISNUMBER(FIND("–", A6:I1000)), CHAR(64+COLUMN(A6:I1000)) & ROW(A6:I1000), "")), ", ", , TRUE)), "No matches found")

curly apostrophe (’)
=IFERROR(TRANSPOSE(TEXTSPLIT(TEXTJOIN(", ", TRUE, IF(ISNUMBER(FIND("’", A6:I1000)), CHAR(64+COLUMN(A6:I1000)) & ROW(A6:I1000), "")), ", ", , TRUE)), "No matches found")

ï (e.g., naïve)
=IFERROR(TRANSPOSE(TEXTSPLIT(TEXTJOIN(", ", TRUE, IF(ISNUMBER(FIND("ï", A6:I1000)), CHAR(64+COLUMN(A6:I1000)) & ROW(A6:I1000), "")), ", ", , TRUE)), "No matches found")

Non-breaking hyphen (‑)
=IFERROR(TRANSPOSE(TEXTSPLIT(TEXTJOIN(", ", TRUE, IF(ISNUMBER(FIND("‑", A6:I1000)), CHAR(64+COLUMN(A6:I1000)) & ROW(A6:I1000), "")), ", ", , TRUE)), "No matches found")

Reset VBA code:

Sub ClearData()
    'ClearData
    Range("A6:L1000").Select
    Selection.ClearContents
    Range("A1").Select
End Sub

How to update formula above that could detect the invisible characters pointed in arrows below (after the text is pasted here, the first inv char "U+A0" is removed):

Screenshot 3

This is the text (same text in the Screenshot 1 above):

See what's hidden in your string…or be​hind ‑-–’

This is the online tool I usually use to check the invisible characters.

Based on Screenshot 1 above, expected result pointed in arrow below (a formula that identifies the cells that contain invisible character):

img10

1 Answer 1

0

If you have a list of non-printable characters you could use a formula like this - it is placed in B4

=LET(TextToCheck,$D$3,invCharacter,A4,
    split,MID(TextToCheck,SEQUENCE(,LEN(TextToCheck)),1),
    unicodeCharacters,MAP(split,LAMBDA(c,UNICODE(c))),
    ISNUMBER(MATCH(invCharacter,unicodeCharacters,0)))

You can visualize each character and each unicode with following formulas:

D3:

=LET(TextToCheck,$D$3,    MID(TextToCheck,SEQUENCE(,LEN(TextToCheck)),1)
    )

D4:

=LET(TextToCheck,$D$3,
    split,MID(TextToCheck,SEQUENCE(,LEN(TextToCheck)),1),
    MAP(split,LAMBDA(c,UNICODE(c)))
    )

Sign up to request clarification or add additional context in comments.

3 Comments

hi, added the text with inv chars in cell d3, added the formula in cell b4, b4 returned false.
I added some intermediate steps - so you can check the text by each charachter - does this help?
ty. it shows all the characters. will there be a way that the formula will only show the cell number of the invisible one like in the last part of the post above?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.