+ Reply to Thread
Results 1 to 5 of 5

UDF to sumproduct with filtered data only

  1. #1
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    UDF to sumproduct with filtered data only

    Hello everyone
    I need a UDF function that enables me to sum with conditions but the sum process for visible rows only after filter mode
    This is an example of the formula
    Please Login or Register  to view this content.
    All what I need UDF to enable me to do sumproduct function with visible rows only.
    The filter would be in several columns .. may be one column to be filtered.. may be two .. May be three or more
    I need something flexible to achieve that
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  2. #2
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: UDF to sumproduct with filtered data only

    This is a sample workbook
    Attached Files Attached Files

  3. #3
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: UDF to sumproduct with filtered data only

    Hi,

    If the hidden rows is caused by applying filter(s) (by AutoFilter or AdvancedFilter), and not by set them manually by hand, then you don't need UDF at all. All that you need is SUMIFS() or SUMPRODUCT() formula (and you are already using it).

    Even if you set the rows hidden manually, you can still use the SUMIFS() or SUMPRODUCT() with a helper column.

    For example, your current function :
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Put this function on Data!M3 and copy down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Then replace the sum range in the original function with this helper column :
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    ---------------------------------------

    But if you insist to use an UDF, this is the code :

    Please Login or Register  to view this content.
    I set the parameter syntax of this function is exactly the same as parameter of SUMIFS() formula, that is :
    - The first parameter is the range of area to be summed
    - The follower parameter is pair(s) of "Range - Criteria", the syntax is same as the SUMIFS() formula

    For example :
    Formula: copy to clipboard
    Please Login or Register  to view this content.





    Regards
    Last edited by karedog; 07-07-2015 at 06:35 AM.

  4. #4
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: UDF to sumproduct with filtered data only

    Mr. Karedog
    I have spent hours to find similar solution but I didn't find any where.. You are UNIQUE AWESOME
    Thank you very much for this great and wonderful UDF
    Thanks for all your help

  5. #5
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: UDF to sumproduct with filtered data only

    You are welcome, thanks for the reps.


    Regards

+ 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. Replies: 5
    Last Post: 06-04-2014, 09:41 AM
  2. Filtered total for SumProduct?
    By ellywooo in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-30-2014, 12:00 PM
  3. Replies: 4
    Last Post: 09-04-2012, 06:09 AM
  4. SUMPRODUCT filtered
    By Donal28 in forum Excel General
    Replies: 4
    Last Post: 09-02-2010, 04:39 AM
  5. Sumproduct A Filtered Column
    By Steve-B in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-03-2008, 09:33 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