+ Reply to Thread
Results 1 to 2 of 2

Making a Complicated Sumproduct into a Function

Hybrid View

  1. #1
    Registered User
    Join Date
    07-07-2014
    Location
    United States
    MS-Off Ver
    2010
    Posts
    30

    Making a Complicated Sumproduct into a Function

    Hi,

    So I have a rather complicated IF, Countif, Sumproduct combo in a formula right now. As you can imagine this makes my worksheet run rather slowly. I was curious if there is any way to make this formula into a User Defined Function. The formula looks like this:

    [CODE]
    =IF(A15="","",IF((AND(COUNTIFS(J:J,J15,AM:AM,ABS(AM15),AD:AD,AD15)>1,(SUMPRODUCT(--($J$17:$J$10000=$J15),--($AD$17:$AD$10000=$AD15),--(ABS($BD$17:$BD$10000)=ABS($BD15)),--($AX$17:$AX$10000=$AX15),$BD$17:$BD$10000))<>ABS(BD15),(SUMPRODUCT(--($J$17:$J$10000=$J15),--($AD$17:$AD$10000=$AD15),--(ABS($BD$17:$BD$10000)=ABS($BD15)),--($AX$17:$AX$10000=$AX15),$BD$17:$BD$10000))<>0)),"Duplicate",IF((AND(COUNTIFS(J:J,J15,AM:AM,ABS(AM15),AD:AD,AD15)>1,(SUMPRODUCT(--($J$17:$J$10000=$J15),--($AD$17:$AD$10000=$AD15),--(ABS($BD$17:$BD$10000)=ABS($BD15)),--($AX$17:$AX$10000<>$AX15),$BD$17:$BD$10000))<>ABS(BD15),(SUMPRODUCT(--($J$17:$J$10000=$J15),--($AD$17:$AD$10000=$AD15),--(ABS($BD$17:$BD$10000)=ABS($BD15)),--($AX$17:$AX$10000<>$AX15),$BD$17:$BD$10000))<>0)),"Research","")))
    [CODE]

    I would not be surprised if this isn't possible but thought I would try. Another possible approach would be to make this into a macro and instead of the output being "Duplicate" or "Research" just have the "Duplicate" Cells Highlighted in Red and the "Research" Celss highlighted in yellow.

    Thanks,
    Justin

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,862

    Re: Making a Complicated Sumproduct into a Function

    First try to limit ranges everywhere - it quite often makes formula faster like:
    Formula: copy to clipboard
    =IF(A15="","",IF((AND(COUNTIFS(J$1:J$10000,J15,AM$1:AM$10000,ABS(AM15),AD$1:AD$10000,AD15)>1, etc.


    then think of splitting into smaller pieces and use helper column it seems, that you force excel to calculate the same sumproduct several times - may be calculate it only once in helper column - less elegant but more efficient :-)
    Best Regards,

    Kaper

+ 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. [SOLVED] Complicated Look Up (without making changes to the values in the table)
    By Excel Dumbo in forum Excel General
    Replies: 9
    Last Post: 10-19-2012, 01:31 AM
  2. making a complicated bar graph
    By harrygorilla in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 01-08-2006, 12:25 PM
  3. complicated sumproduct.
    By Nimit Mehta in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  4. complicated sumproduct.
    By Nimit Mehta in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM
  5. [SOLVED] complicated sumproduct.
    By Nimit Mehta in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-09-2005, 11:05 AM

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