+ Reply to Thread
Results 1 to 2 of 2

Average based on multiple conditions

  1. #1
    Forum Contributor
    Join Date
    03-21-2007
    Posts
    118

    Average based on multiple conditions

    Ok, as per the attached file I have the following problem.

    I have a No of an item, that ranges between 1-40000 or more, a value for the item (let's say price change) and a full date (8 digits as in yearmonthday). I have separated the full date into year, month and quarter.

    What I want to do is to sum the price values by quarter and by No of item. The reason why I want to do this is because I have a few spreadsheets of around 700,000 rows each and I want to reduce the number of rows so that I can handle it in one spreadsheet (and then use a pivot-table or something else for further calculations).

    Can you suggest a way (if there is a macro even better) to sum the prices, by quarter and by item number as well?

    Thanks for any reply.

    EDIT: An alternative solution would be if it is possible to create a pivot-table that reads source data from multiple workbooks (or worksheets). How can I do that?
    Attached Files Attached Files
    _-= Have you google'd your question before posting? =-_
    _-= Have you Searched the forum for an answer before posting? =-_

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: How can I average based on multiple conditions

    Maybe like this:

    Please Login or Register  to view this content.
    The formula in I3 and copied across and down is

    =SUMPRODUCT( ($A$2:$A$38=$H3) * ($D$2:$D$38=I$1) * ($F$2:$F$38=I$2), $C$2:$C$38)

    Or, in list form,

    Please Login or Register  to view this content.
    K7 and down =SUMPRODUCT( ($A$2:$A$38=H7) * ($D$2:$D$38=I7) * ($F$2:$F$38=J7), $C$2:$C$38)

    in either case, I'd change the references to use dynamic ranges on the actual data.
    Last edited by shg; 03-27-2010 at 07:35 PM.
    Entia non sunt multiplicanda sine necessitate

+ 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