+ Reply to Thread
Results 1 to 5 of 5

Sumprodcut formula to return data based on certain date ranges

  1. #1
    Forum Contributor
    Join Date
    07-21-2013
    Location
    washington dc
    MS-Off Ver
    365 MSO
    Posts
    473

    Sumprodcut formula to return data based on certain date ranges

    Hi-

    Please see my attached spreadsheet. The "turnover tab" is pulling in info from the "Trade Blotter Tab" I have just provided a small sample of data. I am trying to sum up the total USD from column "T" in the Trade blotter tab given the specific criteria in my formula in the turnover tab. The formulas can be viewed in the Buy and Sell column. II am trying to pull this data for each month. I am not sure what to add to my formula to only sum up usd for dates 1/1/12-1/30/12 etc for each month. The month formula won't work because I will also have 1/1/13-1/30/13. The trade blotter is coming from an outside system, so i believe dates are string. Please let me know your thoughts.

    THanks
    Attached Files Attached Files

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,311

    Re: Sumprodcut formula to return data based on certain date ranges

    I can't look at it in detail at the moment but you'll need something like:

    =SUMPRODUCT(--(MONTH(Sheet2!$A$2:$A$1000)=MONTH($A2)),--(YEAR(Sheet2!$A$2:$A$1000)=YEAR($A2)),--(other criterion 1),--(other criterion 2))

    Where A2 contains a date in the month/year you are interested in, for example, 1 Jan 2013.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,311

    Re: Sumprodcut formula to return data based on certain date ranges

    Just noticed the comment about dates being text. Select each column of dates and use Data | Text To Columns, delimited, no delimiters required, and then choose Date format and MDY as the format. That will convert to real dates. Do that for each column individually.


    Regards, TMS

  4. #4
    Forum Contributor
    Join Date
    07-21-2013
    Location
    washington dc
    MS-Off Ver
    365 MSO
    Posts
    473

    Re: Sumprodcut formula to return data based on certain date ranges

    Thanks, it worked. Can you explain to me what -- does? I see you use a comma -- instead of the *(

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,311

    Re: Sumprodcut formula to return data based on certain date ranges

    You're welcome.

    Personal choice; the -- is a double negative, that is, it is equivalent to multiplying by -1 twice ... so, a multiplication operation that coerces the results into numeric values. It has the same effect as using the multiplier (*) and there have been various debates about which is most efficient. I'm not sure if a conclusion has ever been reached. When I first was introduced to SUMPRODUCT, many years ago, I seem to recall the first example used -- and I sort of grew up with that. It also makes a more obvious break in the formula so it's easier to see the components ... in my opinion anyway.


    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ 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] Return Max Value in a row based on date ranges.
    By fayep1986 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-04-2013, 12:45 PM
  2. Trying to return scores based on three different data points using ranges
    By txburns in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-27-2013, 06:03 PM
  3. return date based upon look ups in 2 ranges
    By miked18 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-03-2012, 07:02 AM
  4. [SOLVED] Formula to return an answer for 8 different date ranges
    By ecuguy in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-26-2012, 03:37 PM
  5. Replies: 5
    Last Post: 02-10-2012, 12:52 PM

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