+ Reply to Thread
Results 1 to 6 of 6

Conditional formatting (icons) applied to a range using formulas

  1. #1
    Registered User
    Join Date
    02-23-2017
    Location
    Rocky Mountains, USA
    MS-Off Ver
    2016 for mac
    Posts
    10

    Conditional formatting (icons) applied to a range using formulas

    Greetings - I'm using Excel 2011 for Mac.

    Sample file attached.

    Screen Shot 2017-02-22 at 8.53.04 PM.png

    My watered down example consists of tracking "start" and "end" over a period of 7 days. So not including headers/labels there are 2 rows (B2:I3) and 7 columns. The data are all integers. I want to compare the value of B2 to B3 and display a "check" icon in the cell with the greater value and an "x" icon in the other. i'd also like to display the "!" icon if they happen to be equal. When I create a rule and apply it to B2 only, the "check" and 'x" icons display as expected.


    My goal is to apply this rule to the entire range (B2:I2) and have the values being compared iterate to the end of the range. Unfortunately, when I apply it to the range, each successive value is compared to the first value tested ($B$3) and thus the icons do not display properly. I also don't see any way to specify that the "!" icon is to be displayed when the values are equal. Am I missing something?

    Screen Shot 2017-02-22 at 9.06.18 PM.png

    Screen Shot 2017-02-22 at 9.16.04 PM.png

    I tried putting =B3 in the formula but get an error saying that relative references are not allowed. I know I can create a separate rule for each cell, but I find it very hard to believe that this would be the only way to go.

    And finally, I find the 3 sections of the icon set rule dialog to be a little confusing. For the section relating to the "!" icon, it says

    When value is < Formula and
    Which formula is it referring to?


    Similarly, the section for the "x" icon reads:

    When value is < Formula
    Which Formula is THIS one referring to?
    Attached Files Attached Files
    Last edited by daveh0; 02-23-2017 at 07:56 PM. Reason: attached xls file

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Conditional formatting (icons) applied to a range using formulas

    Try to use defined name instead of cell reference.

    to define start value: stay in B2, hit Ctrl-F3:

    Name: Start
    Refer to: B$2
    (B$2 to refer to row2 everywhere you are)

    Similar to define end value:
    Name: End
    Refer to: B$3

    Set icon for value for cell B2:

    First icon: when value is >=; Value:=end; type = Formula

    Second icon: when < Formula (mean < end (cell B3)) and >; value: =0; type: Formula

    Third icon: When <= Formula (mean <=0)

    Hit OK

    Apply to $B$2:$I$2

    Similar process for B3.
    Attached Files Attached Files
    Quang PT

  3. #3
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Conditional formatting (icons) applied to a range using formulas

    Please ignore #2, it is not right solution.

    Try another with INDIRECT to refer to cell, like this:

    =INDIRECT("R2"&COLUMN(),0)

    See attachment.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    02-23-2017
    Location
    Rocky Mountains, USA
    MS-Off Ver
    2016 for mac
    Posts
    10

    Re: Conditional formatting (icons) applied to a range using formulas

    AH HA! I KNEW THERE WAS A WAY. Quite clever sir! Well done and thank you! I will be sure to repost everywhere I was told I couldn't do it with CF and icons. Awesome proble solving!

  5. #5
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Conditional formatting (icons) applied to a range using formulas

    Hi,

    As far as I can see, there is a separate rule for each cell in that workbook, in which case you do not need INDIRECT- you need only refer to the cell above/below directly with a fixed reference.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  6. #6
    Registered User
    Join Date
    02-23-2017
    Location
    Rocky Mountains, USA
    MS-Off Ver
    2016 for mac
    Posts
    10

    Re: Conditional formatting (icons) applied to a range using formulas

    Quote Originally Posted by xlnitwit View Post
    Hi,

    As far as I can see, there is a separate rule for each cell in that workbook, in which case you do not need INDIRECT- you need only refer to the cell above/below directly with a fixed reference.
    Yes, sadly I was a bit overzealous in my reaction... delusions of grandeur perhaps. But yes, my intent is not ot have to maintain multiple rules for what *seems* (to me anyway) to be something that could/should be applied to the entire range with a single rule. I guess I will resort to a VBA solution. Thanks for the replies.

+ 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. Replies: 6
    Last Post: 08-14-2016, 11:42 AM
  2. Conditional Formatting time with a range applied
    By andyp24 in forum Excel General
    Replies: 7
    Last Post: 07-20-2016, 03:51 AM
  3. Conditional formatting with Icons
    By Mantask in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-25-2016, 09:05 AM
  4. [SOLVED] Conditional formatting if A1 in sheet1 is not = A1 in sheet2 applied to a range
    By Mattlawson in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-09-2015, 09:10 PM
  5. [SOLVED] Conditional Formatting using Icons
    By rajeev0508 in forum Excel General
    Replies: 5
    Last Post: 01-22-2013, 11:41 AM
  6. [SOLVED] Custom formulas with icons in conditional formatting in Excel 2010
    By Vinniel in forum Excel General
    Replies: 2
    Last Post: 09-24-2012, 09:20 AM
  7. Conditional formatting icons help
    By bevelman in forum Excel General
    Replies: 5
    Last Post: 12-21-2010, 10:26 AM

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