+ Reply to Thread
Results 1 to 6 of 6

Conditional formula argument limitation or other issue?

  1. #1
    Registered User
    Join Date
    03-07-2011
    Location
    Detroit, MI
    MS-Off Ver
    Excel 2003, 2007, & 2010
    Posts
    52

    Conditional formula argument limitation or other issue?

    Ran into an odd problem where I have 2 conditional formats. The first one greys out a product row for a specific set of location columns if the volume for that product in that location is 0. Note that the code is a bit convoluted as I am using dynamic references to define the cell to look for the volume in.


    Please Login or Register  to view this content.
    This code works just fine.

    I then tried to add an additional condition that makes the cells red if the greyed out cell is not blank but it doesn't seem to work.


    Please Login or Register  to view this content.

    I've used the exact same strategy else where with no problems.

    Any idea what is going on here? I suspect there is a limit on the references or arguments allowed to define a conditional format that I crossed over.

    Below is an example of similar formulas working just fine. Appears to have just as many arguments/references as well if not more.


    Please Login or Register  to view this content.

    Please Login or Register  to view this content.
    FYI this is cross posted here:

    http://www.mrexcel.com/forum/excel-q...ml#post4214462

  2. #2
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Conditional formula argument limitation or other issue?

    If you want the opposite of your first CF rule where the end of the formula is =0 . Why not try replacing the end of the formula with <>0 in a new rule.

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  3. #3
    Registered User
    Join Date
    03-07-2011
    Location
    Detroit, MI
    MS-Off Ver
    Excel 2003, 2007, & 2010
    Posts
    52

    Re: Conditional formula argument limitation or other issue?

    Quote Originally Posted by newdoverman View Post
    If you want the opposite of your first CF rule where the end of the formula is =0 . Why not try replacing the end of the formula with <>0 in a new rule.

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    I'm not exactly looking for the opposite. I just want to highlight cells in red if there is data where there shouldn't be. It should be blank and greyed out if it the volume for that location = 0. If a user accidentally puts data there or the volume goes to 0 I would like it highlighted in red so the user is notified of a change or their error.

  4. #4
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Conditional formula argument limitation or other issue?

    If you post your workbook, perhaps this can be solved. Your formula is using defined names of unknown (to us) purpose.

    I can see from your two provided formulae that the AND version must have both parts of the AND to be TRUE in order for the formatting to be applied. This part COUNTBLANK(Y6)=0 means that Y6 must have a value in order to be TRUE and the rest of the formula which =0 must also be TRUE. Is it possible for those two parts to be TRUE?

  5. #5
    Registered User
    Join Date
    03-07-2011
    Location
    Detroit, MI
    MS-Off Ver
    Excel 2003, 2007, & 2010
    Posts
    52

    Re: Conditional formula argument limitation or other issue?

    Was just solved on the cross posted thread. It was an issue with the Column function returning an array rather than a number.

    COLUMN function returns an "array" even when it's only a single value, e.g. {1} rather than 1 and in some contexts some functions may not handle that as required. The normal solution is to enclose the COLUMN functions inside another function like SUM or MAX which will convert the array to a single value, e.g.

    Simply adding a SUM function around the column operation solved it.


    =AND(COUNTBLANK(Y6)=0,OFFSET($Y6,0,ROUNDDOWN((SUM(COLUMN(Y6)-COLUMN($Y6))/COLUMNS(D2:D2)),0)*COLUMNS(D2:D2))=0)
    Last edited by drew.j.harrison; 07-14-2015 at 08:11 PM.

  6. #6
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Conditional formula argument limitation or other issue?

    Thanks for the feedback. I was looking at that part of the formula and came to the conclusion that there were very limited situations that would produce 0 as a result. If the SUM fixes the problem ....GREAT!

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. Data Validation character limitation issue
    By sj80 in forum Excel General
    Replies: 21
    Last Post: 05-30-2014, 10:22 AM
  2. VBA Argument pass to DLL Issue
    By DougD720 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-27-2014, 09:11 PM
  3. Using an IF argument & COUNTIF argument in the same cell formula
    By TommyK25 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-14-2013, 08:52 AM
  4. Argument of TIME function exceed limitation
    By bebo021999 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-20-2013, 04:48 AM
  5. Conditional formatting limitation
    By efernandes67 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-24-2011, 01:20 PM
  6. Conditional Formatting limitation?
    By Johnny Boy in forum Excel General
    Replies: 0
    Last Post: 05-25-2006, 04:54 PM
  7. [SOLVED] Function (array argument, range argument, string argument) vba
    By Witek in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-24-2005, 11:07 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