+ Reply to Thread
Results 1 to 5 of 5

sum up monthly figures.

  1. #1
    Registered User
    Join Date
    02-08-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    80

    sum up monthly figures.

    Hi could someone assist me

    I have 2 sheet.

    sheet 1 has data.

    column A = Date
    column B = Code
    column C = Qty.

    sheet 2 is where i want to do calculation.

    cell B5 user enters month/year (i.e Aug-09) & press the button for calculation.

    macro will go to sheet 1, check the dates Aug-09 (1st to 31th) looks at the code and sum the qty up.

    sum qty will go against the code.

    please see the attaced file.

    help would be appricated.
    Attached Files Attached Files

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: sum up monthly figures.

    Hi,

    without looking at your workbook, it sounds that you need to learn about Pivot Tables. These are a great tool to summarise data that is in a list form. Pivot tables are not hard to learn. Go to www.contextures.com for some great articles, tutorials and tips.

    cheers

  3. #3
    Registered User
    Join Date
    10-25-2008
    Location
    Mount Joy, PA
    MS-Off Ver
    2003
    Posts
    44

    Re: sum up monthly figures.

    You could also do an array formula. Without looking at your file, something like

    =sum((A1:A10>date(year(b1),month(b1),1))*(A1:A10<=eomonth(b1,0))*(C1:C10))

    Replace A1:A10 and C1:C10 with sheet 1 ranges and b1 with the input on sheet 2. If you want to add the code options (b2 and range B1:B10) then

    =sum((A1:A10>date(year(b1),month(b1),1))*(A1:A10<=eomonth(b1,0))*(B1:B10=B2)*(C1:C10))

    CTRL + Shift + Enter

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: sum up monthly figures.

    Using your actual file I would make the following suggestions

    1 - use Concatenation @ source to negate need for expensive Array formulae

    2 - use LOOKUP to negate need for double evaluation on Monthly Usage sheet

    Re point 1...

    essentially you're looking to conduct a multi condition Summation, pre XL2007 this limits you to Arrays & SUMPRODUCT both of which are expensive in terms of performance and ill advised in large models (ie where the number of cals is remotely extensive).
    You can use Concatenation to create a "key" which then circumvents the need for these approaches given the condition count reverts to one and thus the standard/efficient SUMIF/COUNTIF approaches will suffice. Using your file:

    Consumables Sheet

    Please Login or Register  to view this content.
    (obviously this does not have to be in Col F, it can be out of sight / hidden etc - this is purely for sake of demo)

    what the above is doing is creating a key whereby the date value is adjusted to be 1st of month for all transactions and the code is concatenated to the date creating a month:code key.... this removes need for Array/Sumproduct such that:

    Monthly Sheet

    Please Login or Register  to view this content.
    the above simply conducts a SUMIF whereby the values in the new concatenation column (F) match the Month:Code combination for a given row on the summary sheet.

    Re point 2...

    I noted that you're using a double evaluation process to return description strings from an external file (to handle errors), eg:

    Please Login or Register  to view this content.
    If the values being returned are always strings (not mix of numbers and strings) and descriptions never > 255 chars in length you can avoid the need for double evaluation by using LOOKUP based approach, eg:

    Please Login or Register  to view this content.
    You can change the Null ("") to be whatever text you want to appear when the VLOOKUP returns an Error.

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: sum up monthly figures.

    I too would suggest a PivotTable grouped by Months
    Attached Files Attached Files
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ 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