+ Reply to Thread
Results 1 to 21 of 21

Determine latin characters in cells

  1. #1
    Registered User
    Join Date
    05-01-2012
    Location
    Greece
    MS-Off Ver
    Excel 2010
    Posts
    52

    Determine latin characters in cells

    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

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Determine latin characters in cells

    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), [email protected]

  3. #3
    Registered User
    Join Date
    05-01-2012
    Location
    Greece
    MS-Off Ver
    Excel 2010
    Posts
    52

    Re: Determine latin characters in cells

    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.
    Attached Files Attached Files

  4. #4
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Determine latin characters in cells

    Καλησπέρα.

    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);"")
    Attached Files Attached Files
    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.

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,794

    Re: Determine latin characters in cells

    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:
    Attached Files Attached Files
    Last edited by Pete_UK; 04-11-2013 at 12:23 PM.

  6. #6
    Registered User
    Join Date
    05-01-2012
    Location
    Greece
    MS-Off Ver
    Excel 2010
    Posts
    52

    Re: Determine latin characters in cells

    At first thanks for the replies

    Quote Originally Posted by Pete_UK View Post
    ...CODE applied to any Greek character returns 63
    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
    Please Login or Register  to view this content.
    (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.

    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.

  7. #7
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Determine latin characters in cells

    One thing that I didn't know before this thread is that CODE applied to any Greek character returns 63....
    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.

  8. #8
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Determine latin characters in cells

    ...you have to find the unicode/hex number for the font style you are querying.
    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.

    I have a picture in my sheet of what we see.

    ..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.
    Formula looks to match any letter of the list to eatch cell in column A.

    As the maximum number of characters in a cell is 2^15 -1 (32,767) then 2^15 will fulfil that requirement
    Attached Files Attached Files

  9. #9
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,794

    Re: Determine latin characters in cells

    @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

  10. #10
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Determine latin characters in cells

    Yes Pete exactly as i suspected..
    Perhaps that why Pete's formula looks to don't work for us
    I see what you see in the picture.

    My poor English don't let me to understand well, what Marcol means..

  11. #11
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,794

    Re: Determine latin characters in cells

    I've put a screen shot in my file, so you can see what I see in the UK.

    Pete
    Attached Files Attached Files

  12. #12
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Determine latin characters in cells

    We see completely different things..

  13. #13
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Determine latin characters in cells

    @ 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: copy to clipboard
    Please Login or Register  to view this content.


    Again Paste Special > Values, the result you get.

    Thanks
    Attached Files Attached Files
    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.

  14. #14
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Determine latin characters in cells

    Here you are Marcol.
    Attached Files Attached Files

  15. #15
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Determine latin characters in cells

    And a new one inclunding char...
    Attached Files Attached Files

  16. #16
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Determine latin characters in cells

    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.
    Attached Files Attached Files

  17. #17
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Determine latin characters in cells

    Here you are.......
    Attached Files Attached Files

  18. #18
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Determine latin characters in cells

    @ Fotis

    See what you get with this workbook before I go down the Unicode route.
    Attached Files Attached Files
    Last edited by Marcol; 04-12-2013 at 06:21 PM.

  19. #19
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Determine latin characters in cells

    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)??

  20. #20
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Determine latin characters in cells

    Named Ranges are always treated as arrays by Excel
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    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.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Equally we might use
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    See if this workbook helps.
    Attached Files Attached Files

  21. #21
    Registered User
    Join Date
    05-01-2012
    Location
    Greece
    MS-Off Ver
    Excel 2010
    Posts
    52

    Re: Determine latin characters in cells

    Thanks to everyone for their time!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1