+ Reply to Thread
Results 1 to 12 of 12

Color Cells which do not match criteria-II

  1. #1
    Forum Contributor excelkeechak's Avatar
    Join Date
    07-21-2008
    Location
    India.
    MS-Off Ver
    2013 /2016
    Posts
    363

    Smile Color Cells which do not match criteria-II

    hi, Actually this is a post something like my earlier post

    http://www.excelforum.com/excel-gene...-criteria.html target="_blank">Color Cells Which do not match criteria


    i m having a problem similiar to the above.I tried using the nested ifs in Conditonal formatting but i m getting errors.Can anybody complete my formula
    Attached Files Attached Files
    Last edited by royUK; 05-25-2009 at 08:48 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Color Cells which do not match criteria-II

    Why have you started a new post?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Contributor
    Join Date
    01-05-2004
    Location
    Helsinki, Finland
    Posts
    100

    Re: Color Cells which do not match criteria-II

    Hi,

    if you just want to highlight the wrong country codes, you can use conditional formating. With your given Excel-file, this it how it goes in XL2007:

    1. Select the area, where the users entered country codes are (I2:I12)
    2. Go to Home -> Conditional Formatting -> New Rule... and select Use a formula to determine which cells to format
    3. In the text box Format values where this formula is true type:
    =(VLOOKUP(H3,$B$3:$C$12,2)<>I3)

    here H3 is the first cell in the area that you selected in step 1
    $B$3:$C$12 is the area, where the correct country names and codes are
    I3 is the first user entered country code

    4. Click format and select your favourite error formatting for the wrong contry codes entered.

    5. Click OK and that should do the trick.

    - Asser

  4. #4
    Forum Contributor excelkeechak's Avatar
    Join Date
    07-21-2008
    Location
    India.
    MS-Off Ver
    2013 /2016
    Posts
    363

    Re: Color Cells which do not match criteria-II

    Mr.Roy i thought my problem is different from my earlier post. i m sorry if i had broken any rules.

    Coming to my query, Thanks a lot mr.Jazzer for ur solution. that will work fine if had the same data entered by the operators as in the predefined table.

    what if i had sub regions entered in one of my cells in I Column.i mean if my Country Code start with 975 and a number suffixed to my country code like 12345 or 97512345 .i want the formula for this situation.

  5. #5
    Forum Contributor excelkeechak's Avatar
    Join Date
    07-21-2008
    Location
    India.
    MS-Off Ver
    2013 /2016
    Posts
    363

    Re: Color Cells which do not match criteria-II

    No Solution...??????

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Color Cells which do not match criteria-II

    I hope I understand, you just want to compare the first digit of the cell entered to the first digit of the Country Code in column C? The reason I ask is because you could just verify the WHOLE code, anyway... try this formula in you Conditional Formatting for cells I3:I12

    =LEFT(I3,1)<>LEFT(INDEX($C$3:$C$12,MATCH($H3,$B$3:$B$12,0)),1)

    My formula also highlighted I8 as a mismatch...
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  7. #7
    Forum Contributor excelkeechak's Avatar
    Join Date
    07-21-2008
    Location
    India.
    MS-Off Ver
    2013 /2016
    Posts
    363

    Re: Color Cells which do not match criteria-II

    hmmmmm Dear Mr.JBeaucaire Ur solution would suffice my problem.

    But to elaborate and Make it more clear what i wanted to do is to mark the cells which start with Code 975 and the suffix to this code will be something like12354 for bhutan.i gave the table on the left just for reference.

    Digging further more deeper, if bhutan is selected as country and the code or telephone number for place 'X" in bhutan would start with 975-1234(This is the number for any region/Area/Place "X" in bhutan")

    if bhutan is selected the code should start with 975. and like wise for the rest.hope i had made it more clear


  8. #8
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Color Cells which do not match criteria-II

    Not sure if this is more simply stated or not. Let's get even simpler.

    In column H, please confirm the following number of digits from column C match for the selected country:

    - 1 digit (CF formula shown above already)

    - 2 digits (change the CF formula to: =LEFT(I3,2)<>LEFT(INDEX($C$3:$C$12,MATCH($H3,$B$3:$B$12,0)),2)

    - 3 digits (change the CF formula to: =LEFT(I3,3)<>LEFT(INDEX($C$3:$C$12,MATCH($H3,$B$3:$B$12,0)),3)

  9. #9
    Forum Contributor excelkeechak's Avatar
    Join Date
    07-21-2008
    Location
    India.
    MS-Off Ver
    2013 /2016
    Posts
    363

    Re: Color Cells which do not match criteria-II

    Still not sure.....???OK.........
    hmmmmmmm if the country is Bhutan then the code should start with 97 and if the country is india it should start with 91...
    Further, if the cell contains bhutan in the COUNTRY COLUMN and the code should be something like975xxxxxx(where x denotes...any Telephone Number).
    Like wise,if the COUNTRY is India the code should be 91 and the number xxx suffixed to the code like 91xxxxx

  10. #10
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Color Cells which do not match criteria-II

    You're looking for a CF solution, so you're going to have to settle on the ONE method you're going to employ. 2 digits or 3?

    The formulas to accomplish it either way are provided above.

  11. #11
    Forum Contributor
    Join Date
    02-19-2005
    Location
    Gurgaon,India
    MS-Off Ver
    2007,2010,2013
    Posts
    180

    Re: Color Cells which do not match criteria-II

    Hi,

    Highlight I3:I12

    go to format > conditional formatting..

    formula is:

    =LEFT($I3,LEN(VLOOKUP($H3,$B$3:$C$12,2,0)))+0<>VLOOKUP($H3,$B$3:$C$12,2,0)

    format the cell

    HTH
    Kris

  12. #12
    Forum Contributor excelkeechak's Avatar
    Join Date
    07-21-2008
    Location
    India.
    MS-Off Ver
    2013 /2016
    Posts
    363

    Re: Color Cells which do not match criteria-II

    Thanks very much mr.Krishna for that reply & Solution.it worked fine.

+ 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