Forum Discussion

Sue_L5912's avatar
Sue_L5912
Copper Contributor
Nov 08, 2021

Excel array formula

Hi everyone

When I enter a formula in a single cell and copy it to the cells below, it computes correctly.  However when I force a recalculation (which I have to do as some of the work is dependent on picking up the colour of a cell which Excel does not detect on its own), the formula appears to be modified to an array formula (I think)  - indicated by the { } placed around my formula - and the result of all the calculations show as errors (#value).  I cannot seem to beat Excel at its game and have my formula left as I entered them.  Can anyone shed some light on this problem please.

 

 

5 Replies

  • mathetes's avatar
    mathetes
    Silver Contributor

    Sue_L5912 

     

    Writing a formula that is dependent on picking up the colour of a cell--especially given your qualifier that "Excel doesn't detect [the colour] on its own"--to me sounds like asking for trouble. So some questions:

     

    1. Where does the colour come from in the first place?
    2. Is it possible to place a value in an adjacent cell and let that be the reference used by your formula, rather than a colour that "isn't detected by Excel"?
    • Sue_L5912's avatar
      Sue_L5912
      Copper Contributor

      Thank-you for your message mathetes.

      I have a column where the user can set the colour of individual cells and also enter a value - and I am already using a second column which is populated with a call to my user-function that returns the colour number of the adjacent cell.  It is this column that is the problem - it works fine until I recalculate the spreadsheet, then the {} appear around my function and the whole column evaluates to #Value.   My end purpose is to calculate the sum of the values grouped by colour code.

      I have found a work-around and solution by writing a function that deals with the whole array, filters by colour and gives me the total.  More concise and no need for additional hidden columns!

      (I still do not understand how to defeat the problem that Excel has caused by this new design feature!)

       

      Thank-you again

      • mathetes's avatar
        mathetes
        Silver Contributor

        Sue_L5912 wrote: I have a column where the user can set the colour of individual cells and also enter a value - and I am already using a second column which is populated with a call to my user-function that returns the colour number of the adjacent cell. 

         

        1. The user sets the colour: HOW? By picking one manually from the vast array of background colors available?
        2. And, [the user also] enters a value: in the cell where the user has also set a color, or in another (perhaps adjacent) cell?
        3. Would it be possible to have the color assigned via Conditional Formatting, based on the value entered by the user?  Doing so could obviate the need to call a user-defined-function to derive the colour number. Obviously, I don't know the context here, what your relationship is with "the user" is, clearly somebody other than yourself.
        4. Is it possible for you to attach a copy of the actual spreadsheet? If the actual contains proprietary or confidential information--as well it might--then a mockup that recreates the problem you're struggling with? Verbal descriptions can be helpful, but have their limits.

         

        (I still do not understand how to defeat the problem that Excel has caused by this new design feature!)

         

        What is the "new design feature" you refer to? There are array functions newly released, but I don't think that they're what you're talking about (they don't involve the squiggly brackets).

Resources