+ Reply to Thread
Results 1 to 4 of 4

SUMPRODUCT Formula Help?

  1. #1
    Registered User
    Join Date
    01-14-2004
    Location
    Va Beach, VA
    Posts
    71

    SUMPRODUCT Formula Help?

    Hi All,

    Can anyone helpw with the following?
    I have 3 different categories and need this same style formula in the 2nd and 3rd categories not to exceed the first nor be a negative number.
    1st category max is 45 and is in cell C119
    2nd category mas is 33 and is in cell C120
    3rd Category max is 23 and is in cell C121

    First formula
    =IFERROR(IF(SUMPRODUCT(($A$3:$A$108="ASG")*((GF$3:GF$108="P")))+SUMPRODUCT(($A$3:$A$108="ASG")*((GF$3:GF$108="t")))+SUMPRODUCT(($A$3:$A$108="ASG")*((GF$3:GF$108="a")))>$C$119,$C$119,(SUMPRODUCT(($A$3:$A$108="ASG")*((GF$3:GF$108="P")))+SUMPRODUCT(($A$3:$A$108="ASG")*((GF$3:GF$108="t")))+SUMPRODUCT(($A$3:$A$108="ASG")*((GF$3:GF$108="a"))))),"0")

    My attempt at 2nd formula
    =IF((IF(SUMPRODUCT(($A$3:$A$108="ASG")*((GF$3:GF$108="P")))+SUMPRODUCT(($A$3:$A$108="ASG")*((GF$3:GF$108="t")))+SUMPRODUCT(($A$3:$A$108="ASG")*((GF$3:GF$108="a")))-$C$119>$C$120,$C$120,(SUMPRODUCT(($A$3:$A$108="ASG")*((GF$3:GF$108="P")))+SUMPRODUCT(($A$3:$A$108="ASG")*((GF$3:GF$108="t")))+SUMPRODUCT(($A$3:$A$108="ASG")*((GF$3:GF$108="a")))))-$C$119)>0,SUMPRODUCT(($A$3:$A$108="ASG")*((GF$3:GF$108="P")))+SUMPRODUCT(($A$3:$A$108="ASG")*((GF$3:GF$108="t")))+SUMPRODUCT(($A$3:$A$108="ASG")*((GF$3:GF$108="a")))-$C$119,0)

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: SUMPRODUCT Formula Help?

    i would suggest you upload a sample work book, (all sensitive data removed), showing what data you are working with, what your expected outcome is, and how you arrived at that

    To Attach a File:

    1. Click on Go Advanced
    2. In the frame Attach Files you will see the button Manage Attachments
    3. Click the button.
    4. A new window will open titled Manage Attachments - Excel Forum.
    5. Click the Browse... button to locate your file for uploading.
    6. This will open a new window File Upload.
    7. Once you have located the file to upload click the Open button. This window will close.
    8. You are now back in the Manage Attachments - Excel Forum window.
    9. Click the Upload button and wait until the file has uploaded.
    10. Close the window and then click Submit.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    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: SUMPRODUCT Formula Help?

    ...in addition please add your Excel version and location to your personal details.

    Knowing these often helps when answering queries, and in your particular case if you have Excel 2007 or later then SUMIFS() functions are usually preferred to the older SUMPRODUCT() which was often used as a work around.
    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.

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: SUMPRODUCT Formula Help?

    Use of IFERROR implies that Excel 2007 or later is being used.

    Your first formula takes the form

    =IF(formula>value,value,formula)

    which you could simplify to MIN(formula,value)

    ....and you can combine the SUMPRODUCTs into 1 SUM/COUNTIFS so the first formula can be shortened to

    =MIN(SUM(COUNTIFS($A$3:$A$108,"ASG",GF$3:GF$108,{"p","a","t"})),$C$119)

    and then that should make the second

    =MEDIAN(SUM(COUNTIFS($A$3:$A$108,"ASG",GF$3:GF$108,{"p","a","t"}))-$C$119,$C$120,0)

    ...and third

    =MEDIAN(SUM(COUNTIFS($A$3:$A$108,"ASG",GF$3:GF$108,{"p","a","t"}))-$C$119-$C$120,$C$121,0)
    Last edited by daddylonglegs; 11-28-2012 at 09:07 PM.
    Audere est facere

+ 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