+ Reply to Thread
Results 1 to 10 of 10

Help with Sumproduct function

  1. #1
    Registered User
    Join Date
    10-23-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    6

    Help with Sumproduct function

    Hi All,

    I have a peculiar problem for which I need help. Please consider the following:

    Column A has Dates
    Column B has Dates

    Now I want to count all rows where:
    1> Difference between the two dates is greater than 2 days &
    2> Date in Column A is greater than a give date (Say in cell C1)
    3> Values in Column D do not contain a string

    Now I know this can be done with Sumproduct but am finding it hard to get the exact working formula

    Can someone help please

    =SUMPRODUCT(--((A3:A9999-B3:B9999)>2),--(A3:A9999>C1),--(D3:D9999<>"In Progress"))

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

    Re: Help with Sumproduct function

    Your formula looks valid, doesn't it work? Although in normal circumsatnces, if col B dates are later than Col A your subtraction would be the other way round, i.e.

    =SUMPRODUCT(--(B3:B9999-A3:A9999>2),--(A3:A9999>C1),--(D3:D9999<>"In Progress"))
    Audere est facere

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

    Re: Help with Sumproduct function

    Hi,

    I see absolutely nothing wrong with your formula given those criteria, apart from perhaps: "the difference between the two dates is greater than 2 days", for which you haven't defined which date should be the greater.

    Perhaps you can post a sample workbook illustrating where you think it fails?

    Regards
    Click * below if this answer helped

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

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

    Re: Help with Sumproduct function

    that works just as it is providing dates in col b are earlier than column a, which you could reverse if needed or use abs
    =SUMPRODUCT(--(ABS(A3:A9999-B3:B9999)>2),--(A3:A9999>C1),--(D3:D9999<>"In Progress"))
    "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

  5. #5
    Registered User
    Join Date
    10-23-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Help with Sumproduct function

    Sadly this doesn't work for me

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

    Re: Help with Sumproduct function

    What doesn't work?

    Post a sample workbook, please.

    Regards

  7. #7
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: Help with Sumproduct function

    If A3 is greater then

    =SUMPRODUCT(--(A3:A9999-B3:B9999>2),--(A3:A9999>C1),--(D3:D9999<>"In Progress"))


    If B3 is greater then

    =SUMPRODUCT(--(B3:B9999-A3:A9999>2),--(A3:A9999>C1),--(D3:D9999<>"In Progress"))
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  8. #8
    Registered User
    Join Date
    10-23-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Help with Sumproduct function

    Ok...I think I found the issue...

    Basically there was some text in some rows which was skewing the output...is there any chance that I can add one more criteria to remove that?

    Column B should not contain invalid dates
    Date if present in Column B should be greater than 2 than that in Column A
    Date in Column D should be greater than C1

    eg.
    =SUMPRODUCT(--(B3:B9999<>""),--(B3:B9999<>"In Progress"),--(B3:B9999-A3:A9999>2),--(D3:D9999>C1))

    Cheers
    Last edited by atandon; 10-23-2013 at 08:20 AM. Reason: clarification given

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

    Re: Help with Sumproduct function

    maybe this array entered formula will do the trick as blank-blank =0
    blank -date will be -ve so less than 0
    date -text would be #value which the formula ignores
    =COUNT(IF(ISNUMBER(B1:B100-A1:A100),IF(B1:B100-A1:A100>2,B1:B100-A1:A100)))

  10. #10
    Registered User
    Join Date
    10-23-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Help with Sumproduct function

    Thanks a lot.

    This one worked like a charm

    Cheers,
    Anubhav

+ 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] Sumproduct Function with Other Function References
    By T86157 in forum Outlook Formatting & Functions
    Replies: 4
    Last Post: 07-30-2012, 04:56 PM
  2. Replies: 9
    Last Post: 07-02-2012, 07:02 PM
  3. Replies: 10
    Last Post: 11-11-2010, 03:49 PM
  4. Sumproduct function
    By maestro_uk in forum Excel General
    Replies: 5
    Last Post: 01-08-2008, 10:18 PM
  5. [SOLVED] SUMIF Function Inside SUMPRODUCT Function
    By Abdul Waheed in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 09-19-2005, 12:05 PM

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