Hello. I would like to ask if there is an easy way using a formula to determine if a cell (eg a1) contains latin characters.
Thanks in advance
Hello. I would like to ask if there is an easy way using a formula to determine if a cell (eg a1) contains latin characters.
Thanks in advance
Hi akotronis,
I guess you can use Search function here.. can you upload a sample workbook? thanks.
Regards,
DILIPandey
<click on below * if this helps>
DILIPandey, Excel rMVP
+919810929744 (India), +971528225509 (Dubai), dilipandey@gmail.com
Hi again.
There are four names in the attachment. The actual case contains several thousands. What I would like to do is keep the Greek names, so, assuming that a latin A for example may have been written by mistake in a cell containing a greek name, I would like to identify the cells that contain, say, at least two latin characters inserting a formula at b1 and copying down.
Καλησπέρα.
My suggestion only gives a zero if enen 1 latin character exists.
Type in a coumn the English alphabet. Name it as List.
Then in A1 and copy down use this.
=IFERROR(LOOKUP(2^15;SEARCH(List;A1);A1);"")
Regards
Fotis.
-This is my Greek whisper to Europe.
--Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.
Advanced Excel Techniques: http://excelxor.com/
--KISS(Keep it simple Stupid)
--Bring them back.
---See about Acropolis of Athens.
--Visit Greece.
One thing that I didn't know before this thread is that CODE applied to any Greek character returns 63, so you can make use of this to count how many characters give a code outside this value (the space character returns 32, and you have one of these in each name). Put this array* formula in cell D1 (for example):
=IF(SUM(IF(CODE(MID(A1,ROW(INDIRECT("$1:"&LEN(A1))),1))<>63,1))>=2,"Too many Latins","")
then copy it down. You might want to adjust the >=2 if you have more than a single space. If you just use this array* formula:
=SUM(IF(CODE(MID(A1,ROW(INDIRECT("$1:"&LEN(A1))),1))<>63,1))
then it will count how many latin characters you have in each cell.
*An array formula needs to be committed using the key combination of Ctrl-Shift-Enter (CSE) instead of the usual <Enter>.
Hope this helps.
Pete
EDIT: Sorry, forgot to attach the sample file:
Last edited by Pete_UK; 04-11-2013 at 12:23 PM.
At first thanks for the replies
Actually this doesn't work for me. Every greek letter corresponds to a different code and no one corresponds to 63. So the second formula is just equivalent to len. On column e of your attachment I see 19 19 18 16 21 (which are the corresponding "lens").
The first formula doesn't seem to work neither. It returns "Too many Latins" to all the shells. I modified it to(the range for the greek letters is 193-209, 211-217 for uppercase and 225-241, 243-249 for lowercase) but it doesn't work neither... It returns blank to all the shells.![]()
{=IF(SUM(IF(OR(CODE(MID(A1;ROW(INDIRECT("$1:"&LEN(A1)));1))<193;CODE(MID(A1;ROW(INDIRECT("$1:"&LEN(A1)));1))>249;CODE(MID(A1;ROW(INDIRECT("$1:"&LEN(A1)));1))=210;CODE(MID(A1;ROW(INDIRECT("$1:"&LEN(A1)));1))=242;AND(CODE(MID(A1;ROW(INDIRECT("$1:"&LEN(A1)));1))>217;CODE(MID(A1;ROW(INDIRECT("$1:"&LEN(A1)));1))<225));1))>=2;"Too many Latins";"")}
1) Any reference for the arguments' syntax of the indirect? I haven't seen it before.
2) @Fotis1991, thank you. I am not sure though I understand how the formula works. Specifically the use of 2^15 and the reason it returns the zero when it does.
Any character that isn't Ascii 0 to 255, be it Greek/Urdu/Cantonese/whatever, will return Char(63) and display "?", you have to find the unicode/hex number for the font style you are querying.One thing that I didn't know before this thread is that CODE applied to any Greek character returns 63....
Perhaps that why Pete's formula looks to don't work for us. Or Local settings...I am quite sure that we see something else than you see in UK....you have to find the unicode/hex number for the font style you are querying.
I have a picture in my sheet of what we see.
Formula looks to match any letter of the list to eatch cell in column A...2) @Fotis1991, thank you. I am not sure though I understand how the formula works. Specifically the use of 2^15 and the reason it returns the zero when it does.
As the maximum number of characters in a cell is 2^15 -1 (32,767) then 2^15 will fulfil that requirement
@Fotis:
when I open your file I see 1,2,1,16 in column D, and "Too many Latins" only shows in F2 and F4, although the picture shows it differently.
Must be something to do with local settings.
Pete
Yes Pete exactly as i suspected..
I see what you see in the picture.Perhaps that why Pete's formula looks to don't work for us
My poor English don't let me to understand well, what Marcol means..
I've put a screen shot in my file, so you can see what I see in the UK.
Pete
We see completely different things..
@ Fotis
Could you open the attached file and, with the yellow cells, copy > paste special > values?
If you could then post the result we might better know what a Greek version of Excel sees.
Part of the problem so far is if the strings contain spaces, commas, full stops, etc, or even numbers they will be read as "Latin", that is these universal characters will not return CHAR(63).
I have some UDFs for returning Hex/Unicode. They might be adaptable to get a more universal solution to this thread.
[EDIT]
Could you add to this, in say P1, drag down to P255.
Formula:
=CHAR(ROW())
Again Paste Special > Values, the result you get.
Thanks
Last edited by Marcol; 04-12-2013 at 09:53 AM.
If you need any more information, please feel free to ask.
However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....
Also
اس کی مدد کرتا ہے اگر
شکریہ کہنے کے لئے سٹار کلک کریں
If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.
Here you are Marcol.![]()
And a new one inclunding char...
Hmm?
That isn't at all what I expected to see!
Could we please try again with this workbook?
Just copy > Paste Special > Values , the yellow cells only. Paste the result over the original formulae.
There is more to this than I thought there might be, I expected the result might show some greek characters returned in Column P at least.
Here you are.......
@ Fotis
See what you get with this workbook before I go down the Unicode route.
Last edited by Marcol; 04-12-2013 at 06:21 PM.
Apologize for the delay to reply my friend. Today is Saturday...as you know
YES. Now we see the same result!Excellent work!
When and if you find some free time, would you pls explain your Original formula and formulas for Names(LowerCodes--UpperCodes)??
Named Ranges are always treated as arrays by Excel
Formula:
=INDEX(COLUMN(Sheet1!$A:$Z)+64,,)
So COLUMN(Sheet1!$A:$Z) is effectively {1,2,3......23,24,25,26}
By adding 64 we get {65,66,67......87,88,89,90} the Ascii codes for A-Z.
Similarly by adding 96 we get the codes for a-z.
Notice that we use COLUMN() not COLUMNS()
COLUMNS() returns a single value, in this case it would be 26.
Be careful where you use this, if any columns in the range A:Z are deleted the named range will change.
To minimize the risk of this happening we might refer to a higher range of columns
e.g.
Equally we might useFormula:
=INDEX(COLUMN($CW:$DV)-100+64,,)
Formula:
=INDEX(ROW($1:$26)+64,,)
See if this workbook helps.
Thanks to everyone for their time!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks