+ Reply to Thread
Results 1 to 7 of 7

Conditional formatting on cell with formula

  1. #1
    Forum Contributor heytherejem's Avatar
    Join Date
    07-06-2017
    Location
    Hampshire, England
    MS-Off Ver
    2016
    Posts
    152

    Conditional formatting on cell with formula

    Hi there - hopefully an easy one but I can't figure it out!!!

    I have an Excel report with a range that only populates a figure if there is data to show else it's blank (using an iferror linked to other cells) but I also want the cell to be filled with a colour when there is a figure displayed. I tried Conditional Formatting with an if(not(isblank type thing, but because the cell contains as an iferror at all times, the formatting is always there.

    Any ideas?

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,409

    Re: Conditional formatting on cell with formula

    Will you please attach a sample Excel workbook? We are not able to work with or manipulate a picture of one and nobody wants to have to recreate your data from scratch.

    1. Make sure that your sample data are REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired results are also shown (mock up the results manually).

    3. Make sure that all confidential data is removed or replaced with dummy data first (e.g. names, addresses, E-mails, etc.).

    4. Try to avoid using merged cells as they cause lots of problems.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

    Please pay particular attention to point 2 (above): without an idea of your intended outcomes, it is often very difficult to offer appropriate advice.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Contributor heytherejem's Avatar
    Join Date
    07-06-2017
    Location
    Hampshire, England
    MS-Off Ver
    2016
    Posts
    152

    Re: Conditional formatting on cell with formula

    I've attached sample data, so what I would want is for if data were to populate for Region 6 (this would normally be a pivot which would refresh with new data each month) then the ratios in rows 14 to 16 would appear. As you can see they have an iferror in to ensure column G is blank.
    What I want, is for the colour in rows 14, 15 and 16 to also disappear when there is no data, and to appear when there is data.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Conditional formatting on cell with formula

    Try a formatting rule of

    =LEN(A1)=0

    Change A1 to match your actual data.

  5. #5
    Forum Contributor heytherejem's Avatar
    Join Date
    07-06-2017
    Location
    Hampshire, England
    MS-Off Ver
    2016
    Posts
    152

    Re: Conditional formatting on cell with formula

    Hi Jason,

    This didn't seem to work - still fills the cell with colour if it is "blank" (it's not really blank though because of the iferror formula).
    So perhaps the =LEN is still considering the formula?

  6. #6
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Conditional formatting on cell with formula

    Works for me on your sample file

    It might be a case of excel trying unsuccessfully to be helpful. Clicking on the sheet to select the cell when entering the formula for the formatting rule defaults to absolute references instead of relative ($A$1 when you want A1) that, or something similar is a common cause of conditional formatting not working as expected.

    I've reattached your sample with the conditional formatting in place, see if that helps.
    Attached Files Attached Files

  7. #7
    Forum Contributor heytherejem's Avatar
    Join Date
    07-06-2017
    Location
    Hampshire, England
    MS-Off Ver
    2016
    Posts
    152

    Re: Conditional formatting on cell with formula

    Ah ha! So i've worked out why mine wasn't working - you were making the cell white if there was no data and I wanted the cell to be coloured if there WAS data but white otherwise. So I just changed the =0 to <>0 in the formula and it seems to be working!

    Thanks Jason!!!!! :-)

+ 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: 3
    Last Post: 06-19-2015, 07:16 AM
  2. Conditional formatting if cell contains a formula
    By NS4Excel in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-31-2014, 02:18 PM
  3. Conditional Formatting a cell with a formula in.
    By af25 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 10-01-2014, 07:59 AM
  4. Conditional Formatting if cell contains formula
    By brokenbiscuits in forum Excel General
    Replies: 3
    Last Post: 07-26-2014, 01:45 AM
  5. Conditional formatting a cell containing a formula
    By Nigel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-10-2014, 04:40 AM
  6. [SOLVED] Conditional Formatting a cell that contains a formula
    By jed38 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-08-2014, 11:22 AM
  7. Conditional Formatting on a cell containing a formula
    By ch1co in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-19-2012, 11:12 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