+ Reply to Thread
Results 1 to 3 of 3

cellcolor within formula not returning true statement

  1. #1
    Registered User
    Join Date
    03-04-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    40

    Question cellcolor within formula not returning true statement

    Good Morning,

    I am having trouble with a formula that worked fine Monday and now does not seem to function.

    I have a spreadsheet based on vlookups to populate a 'results' page for printing (all sheets stored in same workbook). All vlookup results are conditional formatted based on different criteria to flag it either green, amber or red.
    I then have 7 cells (which will eventually be buttons) that have intervention methods. These are based on 2-10 cell values being mixes of red, amber or green. Rather than have a massive "nested if" statement determining all the criteria (of which the conditional formatting is based), I have decided to use "=IF(cellcolor,(X,Y)=14)...".
    This worked fine on Monday but now seems to do nothing bar return the false statement.

    The formula I have used is: =IF(CellColour(19,4)=14, IF(CellColour(44,4)=14,"INTERVENTION","FALSE"))

    Thus if both reference cells are 'green (14)' then the formula returns Intervention else false.
    If I manually colour the cells, the formula works however referencing conditionally formatted cells, it worked when I originally wrote it (and changed values to test) but now it doesn't.

    I eventually want to place this into a button so if one of the interventions are flagged - you can click the button to bring up a page referencing the intervention outlines but want to get the main formula working before I go too far ahead.

    Any ideas / advice would very much be appreciated.

    Kind regards,

    Damien
    Last edited by damo_uk; 05-30-2013 at 10:20 AM. Reason: solved

  2. #2
    Forum Contributor
    Join Date
    01-17-2013
    Location
    Belgium
    MS-Off Ver
    Excel 2010
    Posts
    211

    Re: cellcolor within formula not returning true statement

    Recalculate a worksheet or workbook manually by using keyboard shortcuts

    Recalculate formulas that have changed since the last calculation, and formulas dependent on them, in all open workbooks. If a workbook is set for automatic recalculation, you do not need to press F9 for recalculation. F9

    Recalculate formulas that have changed since the last calculation, and formulas dependent on them, in the active worksheet. SHIFT+F9

    Recalculate all formulas in all open workbooks, regardless of whether they have changed since last time or not. CTRL+ALT+F9

    Recheck dependent formulas, and then recalculate all formulas in all open workbooks, regardless of whether they have changed since last time or not. CTRL+SHIFT+ALT+F9
    If solved remember to mark Thread as solved , to mark your thread as Solved select Thread Tools and click Mark thread as Solved.

    I can't read the mind of my wife so then I get picture but no sound .... and then I mostly get the idea, same goes here picture your outcome and I get the idea.

  3. #3
    Registered User
    Join Date
    03-04-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    40

    Re: cellcolor within formula not returning true statement

    Thank you Hulpeloos.

    I tried the above but it did not do anything. I have also researched various codes (http://goo.gl/KwnDD) for extracting the conditional formatting cell background values in 2007 and although it looks promising, it always returned #VALUE or ?NAME unless the cell was directly formatted - in which it returned the correct cell colour value.

    As a work around, I will have to set the statements to mimic the conditional formatting values. Annoying as now any changes in the parameters, I'll have to update in two places - the beauty of using a colour base in the formula was so if the client changes parameters, I'd only have to update the conditional formatting and the formulas would still work.

    Annoyingly this worked on a different machine using the same software version. I am aware 2010 bypasses this issue and the codes I found are defined as temperamental in 2007 and stable in 2003.

    Thanks for all the views and advice.

    I'll flag this as solved even though it's not fully; as research suggests there is no known workaround in 2007...

    Kind regards,

    Damien

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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