+ Reply to Thread
Results 1 to 7 of 7

test if cell contains a matrix formula

  1. #1
    Registered User
    Join Date
    09-15-2009
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    3

    test if cell contains a matrix formula

    I would like to check ( for instance through conditional formatting) if a cell contains a matrix formula or not.

    Sometimes it happens that you forget to press Ctrl+shift+enter after editing a formula.
    This doesn't really show in your sheet and it makes it easy to get unreliable results.

    Therefore I would like to create an alerter

    Thanks for your help!!

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: test if cell contains a matrix formula

    Excel can't determine if you "need" an array formula or not.
    Consequently, I would suggest one of these approaches:

    Try to avoid array formulas by using one of the usual alternatives:
    Examples:
    This array formula:
    =SUM(IF(C2:F5>2,1,0))

    can be replaced with this regular formula:
    =SUMPRODUCT(--(C2:F5>2))

    and...
    This array formula:
    =MAX(MATCH(B2:B5,H2:H5,1))

    can be replaced with this regular formula:
    =MAX(INDEX(MATCH(B2:B5,H2:H5,1),0))

    But, if you must have an array formula that others may edit
    ...here's a method I use to remind them:
    =SUM(IF(C2:F5>2,1,0))+N("remember to Ctrl Shift Enter")
    =MAX(MATCH(B2:B5,H2:H5,1))+N("remember to Ctrl Shift Enter")


    Does that help?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Registered User
    Join Date
    09-15-2009
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: test if cell contains a matrix formula

    Thanks Ron,

    What I really need is just to be able test if a cell currently contains an arry formula which has been activated with shift-ctrl-enter.

    When I am making some reports on a large list of data I might just accidentely forget to press those keys after editing a formula.

    This does not always show in the result but it would be really nice to just see at a glance which cells contain an active array formula just by the color of them for instance.

    Any suggestions?

    Erik

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: test if cell contains a matrix formula

    it would be really nice to just see at a glance which cells contain an active array formula just by the color of them for instance.
    One approach would be to use a UDF... eg:

    Please Login or Register  to view this content.
    Then create a Conditional Format rule, highlighting your selection and applying the rule of

    Please Login or Register  to view this content.

  5. #5
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,454

    Re: test if cell contains a matrix formula

    Or you could do it with conditional formatting.

    Define a "named range" as

    =GET.CELL(49,INDIRECT("rc",FALSE))

    and call it something like ArrayPresent

    Then use conditional formatting to highlight cells where the formula

    =ArrayPresent

    is true
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: test if cell contains a matrix formula

    Just quick note to add that GET.CELL is XLM4 (VBA).... per Chip Pearson quicker than UDF.
    Last edited by DonkeyOte; 09-24-2009 at 04:36 AM. Reason: edited - not sure what I said actually holds true ;-)

  7. #7
    Registered User
    Join Date
    09-15-2009
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: test if cell contains a matrix formula

    Thanks all,

    the "hasarryformula" works like a charm!

    Taking it one step further it would be helpfull to test hom many cells ( if any):
    Do not have an array formula in them
    but
    do have a formula that starts with " sum(if( "

    Thus testing if there are any cells in a sheet where "shift-ctrl-enter" should have been pressed but was not....

    Thanks again!!

    Erik

+ 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