Consulting

Results 1 to 10 of 10

Thread: Solved: Sumproduct Syntax

  1. #1
    VBAX Mentor Hoopsah's Avatar
    Joined
    Nov 2007
    Posts
    303
    Location

    Solved: Sumproduct Syntax

    Hi

    wonder if someone can look at this and point out where I am going wrong.

    I think that this should count 1 after 24/04/09 but I keep getting an answer of 0

    I have attached a copy of my worksheet

    all help appreciated

    Cheers

    Hoopsah
    I am playing all the right notes, but not necessarily in the right order.
    Eric Morecambe

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    What exactly is the logic here Gerry, in business speak? If you are only checking a single date there is no need for SP.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Mentor Hoopsah's Avatar
    Joined
    Nov 2007
    Posts
    303
    Location
    Hi Bob,

    the list shows deleted full time employees, so the list will grow throughout the year,

    Cheers

    Gerry
    I am playing all the right notes, but not necessarily in the right order.
    Eric Morecambe

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    I sorta gathered that Gerry, so I am no wiser yet.

    ARe you trying to count how many people work there for a date, or how many left on that date (or in that week)?
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    VBAX Mentor Hoopsah's Avatar
    Joined
    Nov 2007
    Posts
    303
    Location
    Sorry Bob,

    I was hoping to show how many people had left after a certain date, so I was trying to count how many people had a start date (Deleted_FTE Column E) that is less than the date in column B and that also had a leaving date (Deleted_FTE Column F) that was greater than column B.

    So, with the spreadsheet supplied it should count zero until it reaches row 7, 27/04/09, and then count 1.

    I am obviously doing something really wrong though???
    I am playing all the right notes, but not necessarily in the right order.
    Eric Morecambe

  6. #6
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    I think it is

    =SUMPRODUCT(--(Deleted_FTE!$E$1:$E$2<=B3),--(Deleted_FTE!$F$1:$F$2<=B3))
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  7. #7
    VBAX Mentor Hoopsah's Avatar
    Joined
    Nov 2007
    Posts
    303
    Location
    Fantastic!!

    As usual Bob, your formula works perfectly.

    However, do you know how would I specify the range so that I don't need to keep amending it as the list grows?
    I am playing all the right notes, but not necessarily in the right order.
    Eric Morecambe

  8. #8
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Instead of "Deleted_FTE!$E$1:$E$2" create a Dynamic Range Name In this case
    say DelFTE1 using the Formula =Offset($E$1,0,0,Counta($E:$E),1)
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  9. #9
    VBAX Mentor Hoopsah's Avatar
    Joined
    Nov 2007
    Posts
    303
    Location
    OK, hope I have grasped this correctly - it seems to be working on my spreadsheet so I guess I have.

    I named the first rangeDelFTE1 using mdmackillop's formula of =OFFSET($E$1,0,0,COUNTA($E:$E),1) and created a second range of =OFFSET($F$1,0,0,COUNTA($F:$F),1)

    The used the formula =SUMPRODUCT(--(DelFTE1<=Q3),--(DelFTE2<=Q3))

    Success.

    Thanks for your help MD & Bob

    Cheer - marking as solved

    Gerry
    I am playing all the right notes, but not necessarily in the right order.
    Eric Morecambe

  10. #10
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Hi Gerry
    Just for info (and future use) you can simplify subsequent ranges by offsetting from the first range.
    so DelFTE2 has the formula =Offset(DelFTE1,0,1)
    Regards
    Malcolm
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •