+ Reply to Thread
Results 1 to 7 of 7

Partial match of first N characters conditional formating

  1. #1
    Registered User
    Join Date
    05-15-2018
    Location
    Bratislava
    MS-Off Ver
    2007
    Posts
    4

    Partial match of first N characters conditional formating

    Hi,

    i am new here. I am trying to do simple matcher in excel. I need to compare first 11 characters in A1 cell with first 11 characters in A2:A1000 cells. If the first 11 characters are eqals, it change color to green, else it will be red. In newer version of excel (2013/2016) i simply used format only cell that contains specific text begins with formula: =LEFT($A$1;11). The problem is, 2007 version does not support using formula in this specific conditional formating. What i am trying to do is finding solution for 2007 version. So far i tried to use 2nd column. A column is for value only. B column is, where i try to use adjusted conditional formating.
    I used this formula found on another thread:

    =IF(A1="","",IF(ISNA(MATCH(LEFT($A$1,11)&"*",A1:$A$1000,0)),"NG","OK"))

    it is working well, but only until one special condition happen. I try to explain on example

    81740-G40002018051500001 OK
    81740-G40002018051500005 OK
    81740-G42002018051500003 NG


    These are examples of input in column A. Everything is working. If match - OK, if not match NG. But when i put 4th value that is OK (81740-G40002018051500004 for example) after previous value that was NG it automatically changes all my values in Column B to OK, even when it does not match.

    Please be careful with version. I need to run it on Office 2007 version.

  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,938

    Re: Partial match of first N characters conditional formating

    Hi, welcome to the forum

    I would have thought that this would work, even in 2007, using "Use Formula"...
    =left($A$1,11)=left(A2,11)
    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
    05-15-2018
    Location
    Bratislava
    MS-Off Ver
    2007
    Posts
    4

    Re: Partial match of first N characters conditional formating

    Does not work well. I was able to use it but it is not working well. When i use it, it looks somethink like this

    81740-G40002018051500001
    81740-G40002018051500002
    81740-G40002018051500003
    81740-G42002018051500004
    81740-G42002018051500005
    81740-G40002018051500006

    It will change color of previous cell, not the cell where i put new data. Also it wil change previous cell that should be wrong to green after i input value that match the formula condition.

  4. #4
    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,938

    Re: Partial match of first N characters conditional formating

    Does your data start in A1?
    If not, adjust my formula so it matches the 1st and 2nd rows of your data

  5. #5
    Registered User
    Join Date
    05-15-2018
    Location
    Bratislava
    MS-Off Ver
    2007
    Posts
    4

    Re: Partial match of first N characters conditional formating

    Yes my data starts in A1. I found a solution. The formula does not work properly, if you comparing data with value in same column. So instead i am using formula with conditional formating on column A and comparing to value in cell B1. I just simply use trick B1=A1 and now it works as i wanted. BTW this issue happened only on 2007 version or maybe lower. 2013/2016 works as it should. You can mark this thread as solved.

  6. #6
    Forum Contributor
    Join Date
    03-22-2017
    Location
    Malaysia
    MS-Off Ver
    Excel 2010
    Posts
    230

    Re: Partial match of first N characters conditional formating

    i think FDibbins mean is
    Did you either highlight/apply to A2:A1000 or A:A?

    if you apply to A:A,
    the formula should be below instead
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    if you apply to A2:A100
    you may follow the FDibbins formula.

    finally, you can mark thread solved through
    Thread Tool > Mark thread solved.

  7. #7
    Registered User
    Join Date
    05-15-2018
    Location
    Bratislava
    MS-Off Ver
    2007
    Posts
    4

    Re: Partial match of first N characters conditional formating

    Quote Originally Posted by BoredWorker View Post
    i think FDibbins mean is
    Did you either highlight/apply to A2:A1000 or A:A?

    if you apply to A:A,
    the formula should be below instead
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    if you apply to A2:A100
    you may follow the FDibbins formula.

    finally, you can mark thread solved through
    Thread Tool > Mark thread solved.
    Thanks, your formula worked. I applied to A:A.
    Now i can mark this thread solved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Conditional formating of rows when partial word match in E and non-blank in P
    By Xsample in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-06-2018, 10:28 AM
  2. [SOLVED] conditional formating when characters are more 32 , highlight specified range
    By JEAN1972 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-20-2017, 06:19 PM
  3. Conditional Formating based on a list of special characters
    By fasterthanyours in forum Excel General
    Replies: 10
    Last Post: 07-17-2017, 10:28 PM
  4. [SOLVED] Conditional formating based on text in 2 columns (but only partial text!)
    By Icehockey44 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-19-2012, 06:26 AM
  5. Conditional Formatting Partial Match
    By n3sky in forum Excel General
    Replies: 4
    Last Post: 10-24-2011, 11:40 PM
  6. Conditional Aggregation with Partial Match
    By cclayton in forum Excel General
    Replies: 3
    Last Post: 12-30-2010, 09:24 AM
  7. Conditional formatting for partial number match.
    By SymphonyTomorrow in forum Excel General
    Replies: 1
    Last Post: 12-01-2010, 11:29 PM

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