+ Reply to Thread
Results 1 to 4 of 4

Conditional Formatting Based on a Range of Cells Only Works on 1st Cell

  1. #1
    Forum Contributor
    Join Date
    05-16-2007
    Location
    USA
    MS-Off Ver
    MS Office 2016, Excel 2016
    Posts
    214

    Conditional Formatting Based on a Range of Cells Only Works on 1st Cell

    Having trouble with a conditional-formatting equation. I can get it to work, but for some reason, only the first cell in the range is always compared. The other cells in the range, when satisfying the same condition, will not apply the formatting.

    Ex:

    Cell A88 has a string in it. It never has anything else added to it. It's just a word.
    Cells (range) B88:AX88 have strings in them as well. But some of the words have a space after them with a question mark or a number, like so: word ? or word 1

    I'm trying to apply conditional formatting to the main word in Cell A88 (the one that never has anything added to it) based on two conditions from the cells (B88:AX88). If any cells in the range (B88:AX88) have a "?" appended to it or if it has no number appended to it, then format Cell A88 green. That's all I want to do.

    Yet during testing, only when the 1st cell in the range (B88:AX88) satisfies the condition, does Cell A88 format green. If I change the 1st cell in the range to not satisfy the condition, and then alter the 2nd cell in the range to satisfy the condition, Cell A88 is not formatted green as it should be. This is the same for all remaining cells in the range. I do not understand why this is happening. Does the search function not work with a range of cells?

    Also, I can't get it to work using the "?" in the search equation, even though I have it in quotation marks, so I'm using "test" as my search criteria for now until I figure that part out.

    N/m, I figured out I must escape the "?" with a ~

    Here is what I'm testing with currently:
    Please Login or Register  to view this content.
    Last edited by Modify_inc; 11-03-2018 at 03:48 PM. Reason: Figured out the "?" issue

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: Conditional Formatting Based on a Range of Cells Only Works on 1st Cell

    How about
    =OR(ISNUMBER(MATCH(A88,B88:AX88,0)),ISNUMBER(MATCH(A88&"*~?",B88:AX88,0)))

  3. #3
    Forum Contributor
    Join Date
    05-16-2007
    Location
    USA
    MS-Off Ver
    MS Office 2016, Excel 2016
    Posts
    214

    Re: Conditional Formatting Based on a Range of Cells Only Works on 1st Cell

    Quote Originally Posted by Fluff13 View Post
    How about
    =OR(ISNUMBER(MATCH(A88,B88:AX88,0)),ISNUMBER(MATCH(A88&"*~?",B88:AX88,0)))
    Thank you for the suggestion, but I couldn't get it to do anything after applying it. I tried many different ways of entering values in the cell range to trigger it to format A88, but nothing.

    On a positive note, I did get this to work below, I just don't know how to add the OR logic for the cells that do not contain a number.

    =COUNTIF($B88:$AX88,"*~?")

    I tried the following, but just learned conditional formatting does not work with arrays:
    =NOT(COUNT(FIND({0,1,2,3,4,5,6,7,8,9},B88:AX88))>0

    Note, if a cell does contain a number, it will be appended to the end of the word with a space after the word, like so: word 1.
    Could I use the Right function to determine if the far right place holder is a number, and if so, could I then use the IsNumber function to compare? Is this possible in CF?
    Just trying to think of alternatives since arrays don't work in CF.

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: Conditional Formatting Based on a Range of Cells Only Works on 1st Cell

    Can you supply a workbook with some samples of you data?

+ 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 formatting (based on 2 conditions) on a range of cells
    By stevoDE in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-21-2017, 09:15 AM
  2. [SOLVED] Conditional formatting based on range of cells in different sheet
    By iveta96 in forum Excel Formulas & Functions
    Replies: 41
    Last Post: 06-01-2015, 10:45 AM
  3. Conditional formatting for a range of cells based on data from two cells
    By Tindomerel in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-25-2014, 05:09 AM
  4. Replies: 3
    Last Post: 08-13-2013, 09:44 AM
  5. Conditional Formatting via VBA: Change formatting in range based on value of each cell
    By ralphjmedia in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-12-2013, 10:37 AM
  6. 3+ Conditional Formatting Rules for cell range based on Formula from other cells
    By osborsm9 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-06-2013, 08:48 PM
  7. [SOLVED] Conditional formatting based on dates in a range of cells
    By pmerobertson in forum Excel General
    Replies: 8
    Last Post: 01-10-2013, 12:50 PM

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