+ Reply to Thread
Results 1 to 9 of 9

N(range) problem

  1. #1
    Registered User
    Join Date
    12-03-2010
    Location
    Home
    MS-Off Ver
    Excel 2000
    Posts
    5

    N(range) problem

    When using the N() function on a range, the return is the value of the first cell instead of an array of values, even when used in an array computation:

    =SUMPRODUCT(N(A1:A2))
    returns SUMPRODUCT(N(A1))
    instead of SUMPRODUCT({N(A1);N(A2)})

    Is there any way to successfully compute the latter without volatile instructions or resorting to intermediary cells?

    The reason for the N() function is that the range value may contain text, and would thus raise a #VALUE error.

    For those interested, this is the full, yet faulty expression:
    =SUMPRODUCT(--(ISNUMBER(C139:N139)),1/(N(C139:N139)+0.00000575))

    A working, but volatile array formula:
    {=SUM(IF(ISNUMBER(C139:N139),1/(C139:N139+0.00000575),0))}

  2. #2
    Forum Contributor
    Join Date
    07-05-2006
    Location
    Canada
    MS-Off Ver
    2003, 2007
    Posts
    581

    Re: N(range) problem

    {Ignore}... incorrect.
    Last edited by Maistrye; 12-03-2010 at 05:49 PM.
    ------------------------------------------------------------------------------------------
    If you need no more help on the current problem, please mark it as "Solved". It saves time
    as many of us will look at threads if they are not marked as "Solved".

    The instructions on how to do this are found in the Forum Rules thread that is at top of every forum.
    (Currently you'll have to look at point #9.)
    ------------------------------------------------------------------------------------------

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: N(range) problem

    Welcome to the forum.

    None of those fomulas are volatile.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Registered User
    Join Date
    12-03-2010
    Location
    Home
    MS-Off Ver
    Excel 2000
    Posts
    5

    Re: N(range) problem

    Quote Originally Posted by shg View Post
    Welcome to the forum.

    None of those fomulas are volatile.
    Thanks for the welcome

    And obviously SUMPRODUCT isn't volatile, that's the whole idea.
    However due to the N() function not working as i expected, the formula doesn't work.

    The one that does work is the array function I mentioned at the very end, but all array functions are always volatile.

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: N(range) problem

    ... but all array functions are always volatile.
    That is incorrect; only certain functions are volatile: OFFSET(), INDIRECT(), TODAY(), NOW(), CELL(), INFO(), RAND(), RANDBETWEEN()

  6. #6
    Registered User
    Join Date
    12-03-2010
    Location
    Home
    MS-Off Ver
    Excel 2000
    Posts
    5

    Re: N(range) problem

    Quote Originally Posted by shg View Post
    That is incorrect; only certain functions are volatile: OFFSET(), INDIRECT(), TODAY(), NOW(), CELL(), INFO(), RAND(), RANDBETWEEN()
    Maybe they changed it in later versions, but i can assure you, in Excel2000 all array formulas (those entered with CTRL+SHIFT+ENTER) are volatile.

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: N(range) problem

    I will leave you to your beliefs.

    You may want to read http://www.decisionmodels.com/calcsecretsi.htm. They provide a function that tests/demonstrates whether a given formula is volatile:

    Please Login or Register  to view this content.
    E.g., =CalcCount(A1)

    Press F9 repeatedly; if the number increases, the formula is volatile.

  8. #8
    Registered User
    Join Date
    12-03-2010
    Location
    Home
    MS-Off Ver
    Excel 2000
    Posts
    5

    Re: N(range) problem

    From your same site:
    http://www.decisionmodels.com/optspeedj.htm
    Remember that an array formula is a bit like a volatile formula: if any single one of the cells it references has changed or is volatile or has been recalculated then the array formula will evaluate ALL the cells it references.
    Apparently he classifies it under a different name, but the effect is the same: it causes unneeded recalculations.

    Anyways, this is taking us way of topic... If it makes you happy i'll reformulate my question:
    Is there a non volatile, non array function way to compute this, without resorting to intermediary cells?
    {=SUM(IF(ISNUMBER(C139:N139),1/(C139:N139+0.00000575),0))}

  9. #9
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: N(range) problem

    It is already non-volatile. I don't know of a way to do it other than an array formula. The 0 is unnecessary:

    =SUM(IF(ISNUMBER(C139:N139), 1/(C139:N139 + 0.00000575)))

+ 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