+ Reply to Thread
Results 1 to 9 of 9

How to check multiple cells for a single instance of a capital letter?

  1. #1
    Registered User
    Join Date
    03-25-2013
    Location
    Boulder, colorado
    MS-Off Ver
    Excel 2010
    Posts
    5

    How to check multiple cells for a single instance of a capital letter?

    Need help figuring out how to check multiple cells for a single (at least one) instance of a capital letter? So I thought I would use something like this

    =IF(OR(COUNTIF(AU51:AU60,"D")=0,COUNTIF(AU155:AU158,"D")=0),"D","")

    but the problem is that some of the cells can also contain a lower case "d", so the check is failing...and again, all I need to make sure is that there is at least one capital "D" in any of the cells. Thanks!

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,944

    Re: How to check multiple cells for a single instance of a capital letter?

    Hi and welcome to the forum

    try replacing "D" with CHAR(68)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    03-25-2013
    Location
    Boulder, colorado
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: How to check multiple cells for a single instance of a capital letter?

    Changed it to

    =IF(OR(COUNTIF(AT51:AT60,CHAR(68) )=0,COUNTIF(AT155:AT158,CHAR(68) )=0),"D","")

    but it still counts the lower case d's??

  4. #4
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: How to check multiple cells for a single instance of a capital letter?

    you cannot use "D" with COUNTIF that way - for two reasons - you need to wrap it with wildcard (*) and COUNTIF does not regard case.

    try this ARRAY (see my signature) formula:

    =IF(OR(ISNUMBER(FIND("D",AU51:AU60))+ISNUMBER(FIND("D",AU155:AU158))),"D","-")

    FIND is case-sensitive, SEARCH is not...
    - i.s.z -
    CSE, aka Array aka { }, formulae are confirmed with CONTROL+SHIFT+ENTER.
    Replace commas ( , ) with semicolons ( ; ) in formulae, if your locale setting demands.
    All good ideas are courtesy resources from this forum as well as others around the web.
    - e.o.m -

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,944

    Re: How to check multiple cells for a single instance of a capital letter?

    I changed your references, change them back. I was playing with this, but I'm not sure what your expected answer would be...

    =IF(ISERROR(OR(FIND("D",B3:B8,1)=0,FIND("D",C3:C8,1)=0)),"","D") (find() is case-sensitive)

    If that isnt what you want, can you upload a sample workbook, showing your data (no sensitive info), and some sample answers?

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,944

    Re: How to check multiple cells for a single instance of a capital letter?

    I changed your references, change them back. I was playing with this, but I'm not sure what your expected answer would be...

    =IF(ISERROR(OR(FIND("D",B3:B8,1)=0,FIND("D",C3:C8,1)=0)),"","D") (find() is case-sensitive)

    If that isnt what you want, can you upload a sample workbook, showing your data (no sensitive info), and some sample answers?

  7. #7
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: How to check multiple cells for a single instance of a capital letter?

    =IF(OR(EXACT(A:A,"D"),EXACT(B:B,"D")),"D","")

    this formula will work if want a column that shows which rows have "D" in it....Just change the "A:A" to "B:B" to the ranges you want....HTH
    Ernest

    Please consider adding a * if I helped

    Nothing drives me crazy - I'm always close enough to walk....

  8. #8
    Registered User
    Join Date
    03-25-2013
    Location
    Boulder, colorado
    MS-Off Ver
    Excel 2010
    Posts
    5

    Thumbs up Re: How to check multiple cells for a single instance of a capital letter?

    Thanks judgeh59...that worked perfectly! Being new to this forum, I'm not exactly sure what you meant by asking me to add an "*", so if this isn't it...let me know. I really appreciate all the quick responses and sorry I didn't get a chance to update this thread before I had to run to an appoitment yesterday, but I'll defineatly be back when I need some more help!! Thanks, Mike

    PS: Think I just figured out what you were talking about with the *.

  9. #9
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: How to check multiple cells for a single instance of a capital letter?

    In the lower left corner of the thread there is a little star....it promotes the reputation of the person....also, at the top of the thread is the Thread tools list....this is where you can change the status to Solved....I'm glad I could help....

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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