+ Reply to Thread
Results 1 to 9 of 9

Help with Sumproduct function

  1. #1
    Registered User
    Join Date
    03-12-2007
    Posts
    33

    Help with Sumproduct function

    Hi,

    Can someone tell me if there is something wrong with the below function I'm using.. It keeps returning #VALUE!.

    A2:A50 on the Weekly Stats sheet contain a date.. It's driving me nuts..
    Using Excel 2007.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Help with Sumproduct function

    Either you have an error in one of those cells you reference or you have text in one of those cells.(maybe date is written as text string).

    Select A2:A50 and go to Data|Text to Columns.. skip to the 3rd window and choose Data from the column data format area... then in the drop down select the appropriate format (e.g. MDY or DMY, etc) that you think you have in those cells... click Finish.

    Does that correct it?
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    03-12-2007
    Posts
    33

    Re: Help with Sumproduct function

    Well, that solved the #VALUE! issue but now its just returning 0, when I know I have dates there for January...

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Help with Sumproduct function

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!

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

    Re: Help with Sumproduct function

    You need an extra set of parentheses, i.e.

    =SUMPRODUCT(--(MONTH('Weekly Stats'!A2:A50)=1))

    Note that any blank cell will be deemed to be January so you might want to add another criterion to check that cells are not blank, i.e.

    =SUMPRODUCT(--(MONTH('Weekly Stats'!A2:A50)=1),--('Weekly Stats'!A2:A50<>""))

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Help with Sumproduct function

    Didn't catch that extra set of parentheses

  7. #7
    Registered User
    Join Date
    03-12-2007
    Posts
    33

    Re: Help with Sumproduct function

    Quote Originally Posted by daddylonglegs View Post
    You need an extra set of parentheses, i.e.

    =SUMPRODUCT(--(MONTH('Weekly Stats'!A2:A50)=1))

    Note that any blank cell will be deemed to be January so you might want to add another criterion to check that cells are not blank, i.e.

    =SUMPRODUCT(--(MONTH('Weekly Stats'!A2:A50)=1),--('Weekly Stats'!A2:A50<>""))
    Sorry, don't quite understand what you mean.. What I'm actually trying to check is the date against a string in the F column. In the below case its a time of "8:30 - 16:30"

    Please Login or Register  to view this content.
    Again though its returning a 0 when I know that there is data there..

  8. #8
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Help with Sumproduct function

    Try

    =SUMPRODUCT(--(MONTH('Weekly Stats'!A2:A50)=5)*('Weekly Stats'!F2:F50>=--"08:30:00")*('Weekly Stats'!F2:F50<=--"16:30:00"))

  9. #9
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Help with Sumproduct function

    I think you should attach a sample file if you want accurate results without beating around the bush.

+ 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