+ Reply to Thread
Results 1 to 17 of 17

Need help with useing Sumproduct with named range and date funtion

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

    Need help with useing Sumproduct with named range and date funtion

    Hello there! Hope you can help me....

    I want to be able to find the total miles traveled for a group of employees during a particular date range. I like the use of the "Month" function for ease of use in up dateing the results on the fly.

    The group of employees would be stored in a named range.

    A16:A38 has the list of Employees.
    B16:B38 has the Dates.
    Q16:Q38 has the Miles.
    E7 is the date range I want to sum.
    E8 is the employee or group of employees I want to sum.


    This formula gives me the sum of miles for a date range for a single employee but wont work with a named range for a group of employees.

    =SUMPRODUCT((A16:A38=E8)*(MONTH(B16:B38)=E7),Q16:Q38)

    This formula give me the sum of miles for a whole group of employees but I cant figure out how to add a date range.

    =SUMPRODUCT(SUMIFS(Q16:Q38,A16:A38,INDIRECT(E3)))


    Can you suggest a way to combine these 2 formulas or perhaps something similar that would meet the desired results?

    Thank you in advance.
    Attached Files Attached Files
    Last edited by fgruhlke; 02-16-2014 at 01:00 PM.

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Need help with useing Sumproduct with named range and date funtion

    Hi,

    Assuming your Named Range for employees is called Employees, your first formula would be:

    =SUMPRODUCT((ISNUMBER(MATCH(A16:A38,Employees,0)))*(MONTH(B16:B38)=E7)*Q16:Q38)

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

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

    Re: Need help with useing Sumproduct with named range and date funtion

    I am getting a #VALUE error, sorry for not being more clear, the employee # are alphanumeric ie: "60TE50"

  4. #4
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,447

    Re: Need help with useing Sumproduct with named range and date funtion

    What is E7 actually? A number from 1 to 12 ?

  5. #5
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Need help with useing Sumproduct with named range and date funtion

    It shouldn't matter that they're alphanumeric.

    I think you you should upload a workbook in order for us to be able to determine the issue. Obviously replace any confidential/sensitive information with dummy data if necessary.

    Regards

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

    Re: Need help with useing Sumproduct with named range and date funtion

    E7 = various dates....

    Call Date
    1/2/2014
    2/2/2014
    2/2/2014
    1/2/2014
    3/3/2014
    1/3/2014
    1/3/2014

  7. #7
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,447

    Re: Need help with useing Sumproduct with named range and date funtion

    In this cae perhaps XOR's formula should be amended a bit
    Please Login or Register  to view this content.
    ( without seeing the data on a sample sheet it's a wild guess)

  8. #8
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Need help with useing Sumproduct with named range and date funtion

    Agreed, Pepe. Wild guess. Though am also a bit confused that, if E7 contains an actual date (and not simply a number from 1 to 12), then if, as the OP said:

    "This formula gives me the sum of miles for a date range for a single employee but wont work with a named range for a group of employees"

    how did the formula work in the first place?

    Regards

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

    Re: Need help with useing Sumproduct with named range and date funtion

    =SUMPRODUCT((ISNUMBER(MATCH(A16:A38,Employees,0)))*(MONTH(B16:B38)=MONTH(E7)*Q16:Q38)

    I get a #value error with this as well...

    I did upload the workbook were I am gathering the various sample formulas I will need to build various dashboard style reports.


    Thanks for all the help so far!

  10. #10
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Need help with useing Sumproduct with named range and date funtion

    your range q16:q38 has spaces instead of blanks in some of the cells you cannot multiply a space thats why you get value errors
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  11. #11
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Need help with useing Sumproduct with named range and date funtion

    What precise range did you use for the Named Range Employees when you tried my formula?

    Regards

    Edit: well spotted, Martin!

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

    Re: Need help with useing Sumproduct with named range and date funtion

    XOR LX, I appoligize for my confusion... E7 IS a number 1-12

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

    Re: Need help with useing Sumproduct with named range and date funtion

    From the work book I uploaded..

    =SUMPRODUCT((ISNUMBER(MATCH(A16:A38,Team1,0)))*(MONTH(B16:B38)=E7)*Q16:Q38)

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

    Re: Need help with useing Sumproduct with named range and date funtion

    This works as long as there are no blank cells in Q16:Q38

    =SUMPRODUCT((ISNUMBER(MATCH(A16:A38,Team1,0)))*(MONTH(B16:B38)=E7)*Q16:Q38)

    I can work with this solution... Thank you guys for you help and again, I appoligize for the confusion I created!

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

    Re: Need help with useing Sumproduct with named range and date funtion

    Quote Originally Posted by fgruhlke View Post
    This works as long as there are no blank cells in Q16:Q38

    =SUMPRODUCT((ISNUMBER(MATCH(A16:A38,Team1,0)))*(MONTH(B16:B38)=E7)*Q16:Q38)
    If you use the comma argument separator syntax it will ignore any text entries in the sum range:

    =SUMPRODUCT(--ISNUMBER(MATCH(A16:A38,Team1,0)),--(MONTH(B16:B38)=E7),Q16:Q38)
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

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

    Re: Need help with useing Sumproduct with named range and date funtion

    Excellent work Tony, thank you for the tip!! Works great!

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

    Re: Need help with useing Sumproduct with named range and date funtion

    You're welcome. Thanks for the feedback!

+ 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. Use a Named Range with SumProduct
    By fgruhlke in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 04-08-2014, 08:35 PM
  2. [SOLVED] Removeing duplicates useing current sumproduct formula
    By rogrand in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-03-2013, 03:53 PM
  3. Replies: 4
    Last Post: 04-20-2012, 01:40 PM
  4. 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
  5. Sumproduct with Named Range
    By clng in forum Excel General
    Replies: 2
    Last Post: 11-01-2010, 10:40 PM

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