+ Reply to Thread
Results 1 to 15 of 15

What's wrong with this formula for conditional formatting

  1. #1
    Registered User
    Join Date
    04-05-2014
    Location
    NL
    MS-Off Ver
    Excel 2013
    Posts
    14

    What's wrong with this formula for conditional formatting

    Hi all,

    I've been breaking my head on this all day, can't figure out why it isn't working. All help is welcome.

    I have a worksheet with a list of processes. To the right of the data I've added columns that look up issue numbers based on the process name in an issue table on another worksheet. I want to apply conditional formatting on the issue numbers to highlight their status. The status is contained in the same issue table.

    To look up the issue numbers I use a helper column in the issue table and this formula:
    IFNA(VLOOKUP($B4&" - "&COLUMNS($O$1:O1);Findings;MATCH(Findings[[#Headers];[Nr]];Findings[#Headers];0);FALSE);"")

    Then in my conditional formatting I use the calculated issue number (the outcome of this formula) to lookup the status in the issue table Findings. So for the status closed I use the formula:
    ISNUMBER(SEARCH("closed";VLOOKUP(O4;Findings[[#Data];[Nr]:[Status]];MATCH(Findings[[#Headers];[Status]];Findings[[#Headers];[Nr]:[Status]];0);FALSE)))

    But when I put the formula in the conditional formatting dialog, nothing happens. I do see that Excel puts extra double qoutes (") around my formula.
    I have tested the formula in a regular cell and only get TRUE or FALSE values, so that should not be a problem, right?

    What am I missing here?

    Thanks in advance.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: What's wrong with this formula for conditional formatting

    If Excel is putting quotes around your formula it thinks it's a string, not a formula, and that's why nothing is happening. Are you using "Use a formula to determine which cells to format?" Are you starting with "="?
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    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,830

    Re: What's wrong with this formula for conditional formatting

    You need to start with the equals sign, as Jeff says, but don't put inverted commas around it!
    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.

  4. #4
    Registered User
    Join Date
    04-05-2014
    Location
    NL
    MS-Off Ver
    Excel 2013
    Posts
    14

    Re: What's wrong with this formula for conditional formatting

    Yes, I'm starting the formula with the equal sign, I just posted here without them

  5. #5
    Registered User
    Join Date
    04-05-2014
    Location
    NL
    MS-Off Ver
    Excel 2013
    Posts
    14

    Re: What's wrong with this formula for conditional formatting

    I figured Excel thinks it's a string, but I can't find out why....

  6. #6
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: What's wrong with this formula for conditional formatting

    This will go faster if you attach your file. The paper clip icon does not work for attachments. Instead, under the text box where you type your reply click the Go Advanced button. On the next screen scroll down and click on Manage Attachments, which will show a pop-up window to Select and Upload a file. Then close the window.

  7. #7
    Registered User
    Join Date
    04-05-2014
    Location
    NL
    MS-Off Ver
    Excel 2013
    Posts
    14

    Re: What's wrong with this formula for conditional formatting

    So I've attached an anonimized version of the file. Thanks in advance
    Attached Files Attached Files

  8. #8
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: What's wrong with this formula for conditional formatting

    I am still looking into this but I believe that structured table references do not work in conditional formatting. Using INDIRECT is one workaround but very ugly in this case. I'll see what else I can find.

  9. #9
    Registered User
    Join Date
    04-05-2014
    Location
    NL
    MS-Off Ver
    Excel 2013
    Posts
    14

    Re: What's wrong with this formula for conditional formatting

    I changed the formula to use a regular range instead off the structured table reference and that indeed works. Thanks!

    Still curious if you can find a more robust solution.

  10. #10
    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,830

    Re: What's wrong with this formula for conditional formatting

    What do you mean by "robust"? Are you looking for a dynamic solution?

  11. #11
    Registered User
    Join Date
    04-05-2014
    Location
    NL
    MS-Off Ver
    Excel 2013
    Posts
    14

    Re: What's wrong with this formula for conditional formatting

    I used the structured table references to be more flexible in adding or removing columns from that table. With the current formula their is a risk that they break when I add or remove columns. So the robust solution for me is regaining that flexibility. Nonetheless, it works now.

  12. #12
    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,830

    Re: What's wrong with this formula for conditional formatting

    As I thought - you need it to be dynamic. Thanks for the clarification.

  13. #13
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,913

    Re: What's wrong with this formula for conditional formatting

    You can define names that use the structured references, then use those names in the CF formula.
    Rory

  14. #14
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: What's wrong with this formula for conditional formatting

    rorya's suggestion is a very good one, although the only hitch in your formula would be the column count in VLOOKUP. Otherwise the formula should automatically reflect any addition or removal of columns. To manage the VLOOKUP count, you can use COLUMNS(a1:b1) where a is the first column in your VLOOKUP range, and b is the target column. That will be robust against changes. I can provide details if you show the formula you ended up with.

  15. #15
    Registered User
    Join Date
    04-05-2014
    Location
    NL
    MS-Off Ver
    Excel 2013
    Posts
    14

    Re: What's wrong with this formula for conditional formatting

    I'll give it a try. If not, I'll keep the formulas that are working now and be aware of the adding and deleting columns.

    Thanks for the help.

+ 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] Wrong sum of time, problem with conditional formatting
    By Bossie94 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-21-2017, 08:10 AM
  2. [solved] Conditional Formatting - what am I doing wrong?
    By nukularpower in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 01-09-2016, 08:36 PM
  3. [SOLVED] Conditional Formatting - What am I doing wrong?
    By apaauwe in forum Excel General
    Replies: 8
    Last Post: 11-26-2013, 05:22 PM
  4. [SOLVED] Conditional Formatting is Wrong Color
    By LSC in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-07-2013, 07:52 PM
  5. Highlight a cell with the wrong data without Conditional Formatting
    By k9mikep in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-03-2010, 01:31 PM
  6. Conditional Formatting Code - Deletes Wrong Conditional Format
    By RSpecianJr in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-29-2010, 10:53 AM
  7. Conditional Formatting Help-ome light on what I'm doing wrong
    By amsnss in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-03-2007, 10:38 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