+ Reply to Thread
Results 1 to 9 of 9

Conditional Formatting Formula and Arrays Formulas

  1. #1
    Registered User
    Join Date
    10-24-2019
    Location
    Australia
    MS-Off Ver
    Version 1909 (Build 12026.20334) Monthly Channel
    Posts
    7

    Conditional Formatting Formula and Arrays Formulas

    Hi All,
    I have an dummy formula that WORKS as an array formula (punches out true and false in the right spots) when entered into the cell and dragged, but cant seem to get it to work as conditional formatting.

    Every time it says there is an error with the formula, tried entering it normally, using the ctrl+Shift+enter method and with the curly brackets manually

    column C contains the value to lookup on table 2, row 2 is the data it wants to match to the data on table 2 (in the 15th to 55th column)
    extra if statement to not produce errors is column C is blank,

    dummy formula in G5:
    =IF($C5="",FALSE,OR(G$2=VLOOKUP($C5,table2,(15:55),FALSE)))

    as an array formula so Ctrl+Shift+Enter, should look like
    {=IF($C5="",FALSE,OR(G$2=VLOOKUP($C5,table2,(15:55),FALSE)))}

    Any ideas?
    Edit: Using office 365 Excel Version 1909 (build 12026.20334) Monthly Channel
    Edit 2: the 15:55 in the actual dummy formula are named values corresponding to the start and end of what it is trying to match
    Edit 3: sample file uploaded
    Attached Files Attached Files
    Last edited by DangerNoodle; 10-24-2019 at 04:12 AM.

  2. #2
    Forum Expert tim201110's Avatar
    Join Date
    10-23-2011
    Location
    Russia
    MS-Off Ver
    2016, 2019
    Posts
    2,357

    Re: Conditional Formatting Formula and Arrays Formulas

    what does this (15:55) mean? rows?
    please upload your file

  3. #3
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Conditional Formatting Formula and Arrays Formulas

    Without seeing your sheet we can keep guessing.
    A couple of tips : CF considers formulas as array formulas by default. No curly braces needed
    The IF function is implicit in CF, so it is not needed either

    Please upload a workbook or a representative cut down copy, anonymized if necessary. It is always easier to advise if we can see your request in its context.

    Show a before and after situation with manually calculated results, explaining which information is data and which is results, and if it's not blindingly obvious how you have arrived at your results some explanatory notes as well.

    To upload a file click the Go Advanced button at the foot of your post, look underneath the post area for the Manage Attachments section and take it from there.

  4. #4
    Registered User
    Join Date
    10-24-2019
    Location
    Australia
    MS-Off Ver
    Version 1909 (Build 12026.20334) Monthly Channel
    Posts
    7

    Re: Conditional Formatting Formula and Arrays Formulas

    Dummy file attached.

  5. #5
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Conditional Formatting Formula and Arrays Formulas

    OR(G$2=VLOOKUP($C5,table2,(15:55),FALSE))

    What are your ORing this with?
    This is not how to use OR

    OR(A1="Black"1,A1="White")

    If A1 is Black or White then return TRUE

    You have only one parameter in your OR() formula G$2=VLOOKUP($C5,table2,(15:55),FALSE)
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  6. #6
    Registered User
    Join Date
    10-24-2019
    Location
    Australia
    MS-Off Ver
    Version 1909 (Build 12026.20334) Monthly Channel
    Posts
    7

    Re: Conditional Formatting Formula and Arrays Formulas

    the 'or' function is to check if there is a valid match in the array in columns 15-55 based on the vlookup.
    have tried it without the 'or' function on the dummy file and don't get the intended results.

    If the file isn't clear to anyone, please let me know.

  7. #7
    Registered User
    Join Date
    10-24-2019
    Location
    Australia
    MS-Off Ver
    Version 1909 (Build 12026.20334) Monthly Channel
    Posts
    7

    Re: Conditional Formatting Formula and Arrays Formulas

    Found this:
    "Conditional formatting will not look at other tabs in your sheet directly (and don't even think about looking at another file), you must use the INDIRECT function to reference a different tab within your sheet."
    on this page: (url removed until i am allowed to by site), by KarlS.

    Does this explain why the dummy formula works and the conditional formatting doesn't?
    If so how would i go about solving this?

    Edit: when using below the formula ,on the sqample file
    OR(G$2=VLOOKUP($C5,indirect("table2"),(re1_:re13_),FALSE))
    the dummy formula works for putting out true and false in the correct spots, but not when attempting to use this as a CF formula. It gives the error "You may not use reference operators (such as unions, intersections, and ranges) or array constants for Conditional Formatting Criteria.
    Edit2: re1_ and re13_ are named values.
    the Conditional formatting seems to now have an issue with the 're1_:re13_' part whereas using it as a dummy formula doesnt?

    do i have to do it all individually? i.e. =OR ( G$2= VLOOKUP($C5,indirect("table2"),(re1_),FALSE, G$2=VLOOKUP($C5,indirect("table2"),(re2_),FALSE, ... ))
    ... would continue all the way to 'G$2=VLOOKUP($C5,indirect("table2"),(re40_),FALSE,'
    in the actual data (not the sample sheet)
    Last edited by DangerNoodle; 10-25-2019 at 03:28 AM.

  8. #8
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,554

    Re: Conditional Formatting Formula and Arrays Formulas

    I feel as if your best option is going to be to use rows 10:12 as helpers, which may be moved and/or hidden for aesthetic purposes, then conditionally format rows 13:15 using: =C10=TRUE
    Sorry not to be of more help.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  9. #9
    Registered User
    Join Date
    10-24-2019
    Location
    Australia
    MS-Off Ver
    Version 1909 (Build 12026.20334) Monthly Channel
    Posts
    7

    Re: Conditional Formatting Formula and Arrays Formulas

    So i have self solved,
    1st part of the problem was using the 'indirect("table2") instead of just table2 as conditional formatting formulas don't like looking at other sheets even with VLOOKUP.
    2nd part of the problem was that conditional formatting formulas dont seem to like the : operator as i am using it, so i did each part as a seperate 'or' test, as per my previous post
    ' =OR ( G$2= VLOOKUP($C5,indirect("table2"),(re1_),FALSE, G$2=VLOOKUP($C5,indirect("table2"),(re2_),FALSE, ... ))
    ... would continue all the way to 'G$2=VLOOKUP($C5,indirect("table2"),(re40_),FALSE,

    so unless someone has a more elegant solution to Conditional Formatting Vlookup an array of defined names, i'll call it solved but nasty.

    (Updated to hopefully help people in the future searching for similar terms)

+ 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. Conditional Formatting with AND function for black & non-blank arrays.
    By Quasar82 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-05-2016, 05:43 AM
  2. Replies: 4
    Last Post: 02-16-2016, 03:41 AM
  3. Advanced Nesting? Using Formulas within formula arrays
    By Speshul in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-15-2014, 10:43 AM
  4. Replies: 8
    Last Post: 03-22-2013, 03:40 PM
  5. Conditional Formatting based on other arrays
    By Sccye in forum Excel General
    Replies: 3
    Last Post: 03-06-2012, 01:38 PM
  6. Conditional formatting multiple conditions (arrays?)
    By Pyrex238 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-05-2011, 02:54 PM
  7. Arrays in Conditional Formatting
    By Dancin in forum Excel General
    Replies: 4
    Last Post: 10-12-2009, 06:20 AM

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