Results 1 to 6 of 6

sumproduct not calculating the correct dates

Threaded View

  1. #1
    Registered User
    Join Date
    08-13-2009
    Location
    USA
    MS-Off Ver
    Excel 2000 and 2007
    Posts
    5

    sumproduct not calculating the correct dates

    I have put together the following code (with help from this and another forum):

    
    Dim Res1 As Integer
    Res1 = Worksheets("sheet1").Evaluate("=sumproduct(--(am1:am30000>=date(2009,08,01)),--(am1:am30000>date(2009,09,01)),BN1:BN30000)")
    MsgBox Res1

    it seems to work (by which i mean it runs error free). However the number it calculates is not correct.

    I came up with this code to do the following:

    Check for a date between 2 dates (08/01/09 and 09/01/09 for example).
    Then add up and return all the values in BN1:BN30000 for any rows that have a date matching that query.


    However what the code above seems to give me is anything greater that 9/1/09

    thanks
    Last edited by Lman; 08-17-2009 at 02:02 PM. Reason: fix title

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