+ Reply to Thread
Results 1 to 2 of 2

Sumproduct and dates

  1. #1
    Registered User
    Join Date
    08-22-2006
    Posts
    28

    Sumproduct and dates

    Here is what I have:

    =SUMPRODUCT(--(TEXT(DATE(YEAR(N(OFFSET(H49:BG49,0,{0,1,4,7,11,15,16,20,24,25,29,33,34,38,42,43,47,51},1,1))),
    MONTH(N(OFFSET(H49:BG49,0,{0,1,4,7,11,15,16,20,24,25,29,33,34,38,42,43,47,51},1,1))),1),"yymm")=T EXT(TODAY(),"yymm")))

    Basically this sums all dates that fall this month across a bunch of cells. How can I change this to sum all dates falling next month?

  2. #2
    Valued Forum Contributor Excelenator's Avatar
    Join Date
    07-25-2006
    Location
    Wantagh, NY
    Posts
    333
    Change:
    =SUMPRODUCT(--(TEXT(DATE(YEAR(N(OFFSET(H49:BG49,0,{0,1,4,7,11,15 ,16,20,24,25,29,33,34,38,42,43,47,51},1,1))),
    MONTH(N(OFFSET(H49:BG49,0,{0,1,4,7,11,15,16,20,24, 25,29,33,34,38,42,43,47,51},1,1))),1),"yymm")=TEXT(TODAY(),"yymm")))


    To:
    =SUMPRODUCT(--(TEXT(DATE(YEAR(N(OFFSET(H49:BG49,0,{0,1,4,7,11,15 ,16,20,24,25,29,33,34,38,42,43,47,51},1,1))),
    MONTH(N(OFFSET(H49:BG49,0,{0,1,4,7,11,15,16,20,24, 25,29,33,34,38,42,43,47,51},1,1))),1),"yymm")=TEXT(DATE(YEAR(TODAY()),MONTH(TODAY())+1,1,"yymm")))
    ---------------------------------------------------
    ONLY APPLIES TO VBA RESPONSES WHERE APPROPRIATE
    To insert code into the VBE (Visual Basic Editor)
    1. Copy the code.
    2. Open workbook to paste code into.
    3. Right click any worksheet tab, select View Code
    4. VBE (Visual Basic Editor) opens to that sheets object
    5. You may change to another sheets object or the This Workbook object by double clicking it in the Project window
    6. In the blank space below the word "General" paste the copied code.

+ 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