+ Reply to Thread
Results 1 to 6 of 6

Adjusting Sum Product for Date

  1. #1
    Forum Contributor
    Join Date
    02-20-2007
    MS-Off Ver
    2003 & 2007
    Posts
    299

    Adjusting Sum Product for Date

    I have this formula: SUMPRODUCT(--($D$7:$D$19-DAY($D$7:$D$19)+1=K$5)*($J$5=$I$25)*($J$7:$J$19))

    The formula works great. My problem is that K5 has to be the 1st day of the month for it to work. I need it to be the last day of the month, but I don't know how to modify the formula.

    The goal of the formula is to sum all numbers in my "J" range if the dates in my "D" range equal the same month/year as my "row 5" guy or in this example K5. I also equated J5 with I25 in order to complete the sum product formula.

    Thank you for your time and help

  2. #2
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    This will change your date to the 1st of the month

    =DATE(YEAR(A3),MONTH(A3),1)
    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  3. #3
    Forum Contributor
    Join Date
    02-20-2007
    MS-Off Ver
    2003 & 2007
    Posts
    299
    I need K5 to read the last day of month (ex. 1/31/2007)

    So How would I include your formula in mine to convert the 1/31/2007 to 1st of the month thus making the original formula work, but leaving K5 showing the last day of the month.

  4. #4
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Try this,

    SUMPRODUCT(--($D$7:$D$19-DAY($D$7:$D$19)+1=DATE(YEAR(K$5),MONTH(K$5),1))*($J$5=$I$25)*($J$7:$J$19))

  5. #5
    Forum Contributor
    Join Date
    02-20-2007
    MS-Off Ver
    2003 & 2007
    Posts
    299
    Wow! that's very cool. Works great. thank you very much.

  6. #6
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Glad to help - thanks for the feedback

+ 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