+ Reply to Thread
Results 1 to 10 of 10

Use a Named Range with SumProduct

  1. #1
    Registered User
    Join Date
    01-18-2014
    Location
    Chicago
    MS-Off Ver
    Excel 2013
    Posts
    88

    Use a Named Range with SumProduct

    Not sure if this is possible..

    I have the following formula that finds the value for "Available Hours" for "10TE01 LEO REILLY" in the "BW" segment of the attached spread sheet located in cell "B10"


    Cell M2 contains the following formula

    =INDEX('Month-1'!$A$1:$G$6000,MATCH(TRUE,INDEX(1/('Month-1'!$A$1:$A$6000=$L2)*ROW('Month-1'!$A$1:$A$6000)-MATCH($K$2,'Month-1'!$B$1:$B$6000,0)>0,),0),MATCH($M$1,'Month-1'!$A$14:$G$14,0))

    This is just an example of several different values I need to find in this data sheet that can be 5000 or more lines.

    This is tested and works great to find this value for any employee entered into cell K2. The formula is designed to account for the possibility of additional lines being added to the data sheet, something I can not control.

    What I want to be able to do is substitute the value in K2 with a named range and return the sum of the values for "Available Hours" for that range or team of employees. If I can get that to work I think I can figure out how build a similar formula that would return the Average for other data points for a team.

    I have gotten this far with a lot of help from the folks in this forum, so thank you for any further considerations!!!
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    12-25-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2016
    Posts
    506

    Re: Use a Named Range with SumProduct

    Hi, try solution below:
    Formula: copy to clipboard
    Please Login or Register  to view this content.




    _______________________________________________________________________________________________________________________________
    1. Click on the * Add Reputation if you think someone helped you
    2. Mark your thread as SOLVED when question is resolved

    Alvin

  3. #3
    Registered User
    Join Date
    01-18-2014
    Location
    Chicago
    MS-Off Ver
    Excel 2013
    Posts
    88

    Re: Use a Named Range with SumProduct

    This seems to working great! Solid solution to the task at hand.. Thank you, Thank you, Thank you!! I will work on a similar formula to count the values , then combine the 2 formulas to find an average.

    Thanks Again!!

  4. #4
    Valued Forum Contributor
    Join Date
    12-25-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2016
    Posts
    506

    Re: Use a Named Range with SumProduct

    You're welcome, thank you for the feedback and reputation
    Glad it helps.



    _______________________________________________________________________________________________________________________________
    1. Click on the * Add Reputation if you think someone helped you
    2. Mark your thread as SOLVED when question is resolved

    Alvin

  5. #5
    Registered User
    Join Date
    01-18-2014
    Location
    Chicago
    MS-Off Ver
    Excel 2013
    Posts
    88

    Re: Use a Named Range with SumProduct

    Alvin, thank you again, I am struggling with modifying the formula you provided to return an average rather then a sum of a particular data point in the same work book. Some times I will need that result by team as well so I know we are close.

    I figure I need to add the ability for your formula to first count the number of values I am summing, then divide the actual sum by that number.. correct?


    Again, thanks for any suggestions!

  6. #6
    Valued Forum Contributor
    Join Date
    12-25-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2016
    Posts
    506

    Re: Use a Named Range with SumProduct

    Do you mean:
    Formula: copy to clipboard
    Please Login or Register  to view this content.




    _______________________________________________________________________________________________________________________________
    1. Click on the * Add Reputation if you think someone helped you
    2. Mark your thread as SOLVED when question is resolved

    Alvin

  7. #7
    Registered User
    Join Date
    01-18-2014
    Location
    Chicago
    MS-Off Ver
    Excel 2013
    Posts
    88

    Re: Use a Named Range with SumProduct

    Once again, Perfect! You have saved me many hours. Thank you for your time and sharing your skills in helping me learn!

  8. #8
    Valued Forum Contributor
    Join Date
    12-25-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2016
    Posts
    506

    Re: Use a Named Range with SumProduct

    You're welcome, have fun with Excel!



    _______________________________________________________________________________________________________________________________
    1. Click on the * Add Reputation if you think someone helped you
    2. Mark your thread as SOLVED when question is resolved

    Alvin

  9. #9
    Registered User
    Join Date
    01-18-2014
    Location
    Chicago
    MS-Off Ver
    Excel 2013
    Posts
    88

    Re: Use a Named Range with SumProduct

    alvin-chung, nearing the completion of my product I discovered that some of the cells this formula reads may be blank or contain a dash, causing the average to be wrong..

    here is the actual formula I am now using.. The second part after the "/" only counts the number of team members in the named range located in $A$2

    {=SUMPRODUCT(IFERROR(ISNUMBER(MATCH(ROW('Month-3'!$B$1:$B$6003),MATCH(INDIRECT($A$2),'Month-3'!$B$1:$B$6003,0)+MATCH($AJ13,'Month-3'!$A$1:$A$6003,0)-MATCH($AJ$2,'Month-3'!$A$1:$A$6003,0),0))*'Month-3'!E$1:E$6003,0))/SUMPRODUCT(--(IFERROR(MATCH(INDIRECT($A$2),'Month-3'!$B$1:$B$6003,0)>0,0)))}

    Anything you can do would be so appreciated!

    In the sample work book cell G13 needs to return the average of the highligted cells on sheet "Month-3"
    Attached Files Attached Files
    Last edited by fgruhlke; 04-07-2014 at 03:45 PM.

  10. #10
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Use a Named Range with SumProduct

    Would it be possible for you to make up a small sample file with about 20 rows worth of data that demonstrates what you want to do?

    I have a "thing" about working on peoples real files full of irrelevant data to the task at hand. Makes it harder to "see" what needs to be done.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ 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] Determine what Named Range the Target Address is and return Named Range Name
    By jordan2322 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-18-2012, 10:49 PM
  2. Using average on Named Range in SUMPRODUCT
    By Lifeseeker in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 11-22-2011, 03:41 PM
  3. SUMPRODUCT with cell reference to named range
    By ITC in forum Excel General
    Replies: 2
    Last Post: 11-21-2010, 04:50 PM
  4. Sumproduct with Named Range
    By clng in forum Excel General
    Replies: 2
    Last Post: 11-01-2010, 10:40 PM
  5. Sumproduct across multiple sheets using named range
    By reggie1000 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-01-2008, 09:25 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