+ Reply to Thread
Results 1 to 5 of 5

Calculating median on a filtered range. custom defined function. #NAME error in cell

  1. #1
    Valued Forum Contributor
    Join Date
    10-21-2011
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    513

    Calculating median on a filtered range. custom defined function. #NAME error in cell

    Hi there,

    I am trying to calculate for a sum on a filtered range with the help of a customer defined function.

    Please Login or Register  to view this content.
    In cell D1, I have:
    Please Login or Register  to view this content.
    I am getting a "NAME?" error. I am not sure if it is syntax error or something missing in the custom defined function code.

    Anybody able to assist?
    Last edited by Lifeseeker; 02-22-2012 at 11:06 AM. Reason: additional help required

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Calculating sum on a filtered range. custom defined function. #NAME error in cell

    Hi,

    Why are you even bothering with an inefficient looping user defined function when there is a perfectly simple bog standard Excel function.

    E1: =SUBTOTAL(9,B3:B17)

    Never use VBA when you can use standard Excel functionality. It's generally much slower, particularly if loops are involvedand can sometimes react not as you imagine.

    Regards
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Valued Forum Contributor
    Join Date
    10-21-2011
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    513

    Re: Calculating sum on a filtered range. custom defined function. #NAME error in cell

    ah I see. Actually, I just found out about that as well....

    What about if I wanted to do a median() calculation on filtered range? Will that require a custom function or?

    Thank you

  4. #4
    Valued Forum Contributor
    Join Date
    10-21-2011
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    513

    Re: Calculating sum on a filtered range. custom defined function. #NAME error in cell

    got it to work using this, but it might inefficient I suppose?

    Please Login or Register  to view this content.

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Calculating sum on a filtered range. custom defined function. #NAME error in cell

    Hi,

    Not as inefficient as a looping UDF!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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