+ Reply to Thread
Results 1 to 7 of 7

Help with SUMIF function and dates

  1. #1
    Registered User
    Join Date
    04-19-2013
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    2

    Help with SUMIF function and dates

    Hi Everyone,

    This is my first post to this forum, so please forgive any blunders.

    I'm looking for some help sorting through some sales data for our farming business which runs into thousands of lines. I wanted to analyse the data as follows:

    (A) Total Sales Per Month: easy to do manually, but I'm struggling with how to use date functions within SUMIF
    (B) Total Sales By Product By Month: I've tried using SUMIF($D$45:$D$108,$A14,$H$45:$H$108) // but the range has to be updated manually for each month which cumbersome // I think I need to incorporate a date function, but you don't seem to be able to do nested functions in SUMIF
    (C) Total Sales By Customer By Month: in March 2011 we start specifying the name of the customer as opposed to just writing "Cash Sales"

    I would appreciate any help or suggestions - there are 30,000 lines, so it would take me years to do this manually!!!!

    I've attached a file with a data extract.

    Thanks
    Andrew
    Mar-10 Apr-10 May-10 Jun-10 Jul-10 Aug-10 Sep-10 Oct-10 Nov-10 Dec-10
    (A) Total Sales per Month

    (B) Total Sales by Product by Month
    12 pce Braai Pack Chicken
    Afhal mixed
    Bacon
    Basil and Avo Dressing
    Biltong - Chicken chilli bite
    Biscuits
    Bones - Pork
    Boschveld Cockerels
    Braai Pack 12 pce
    Breast Fillets
    Breast Fillets SMOKED
    Broilers Live Chickens
    BULK Breast Fillets
    BULK Burgers (10s)
    BULK Drumsticks
    BULK Leg Quarters
    BULK Mince
    BULK Thighs
    Burgers Chicken
    Burgers Chicken Budget 100g
    Butter

    We will need to define a unique list of all products - Is there a function to do this automatically from a data list on another tab - i.e. If we add a new months data and have new products, it updates the list in this report


    (C) Total Sales By Customer By Month:
    Ancel
    Cash Sales
    Clinton Muller
    Louise Leak
    Phinn
    Sally
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Help with SUMIF function and dates

    Hi, and welcome, try SUMIFS (rather than SUMIF)
    CC


    If you feel really indebted please consider a donation to charity. My preferred charity is ActionAid but there are plenty of worthy alternatives.

  3. #3
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,739

    Re: Help with SUMIF function and dates

    I have created two very quick Pivot tables (takes a few minutes) and put onto new sheets - these can be changed and formatted very easily

    product
    Customer

    I have then just formatted the Date in the pivot table to display as you required

    Now with a pivot table you can do a lot of analysis , filter and if we change the data to be a list on 2003 or as a table in 2007/2010 - as you enter new data , the pivot table range will extend and all you need to do is refresh the pivot tables and it will add new products and new customers automatically

    (the list function, I used on office 2003 - so it may be there is a better way to do this in later versions )

    - what version do you have ?

    if you dont know pivot tables - there are quite a few tutorials -
    BUT please ask any questions here and i can do my best to answer

    attached the new sheet -

    I think using a pivot table will give you much more control over the report and analyse
    you can select the items you want to show with just a few clicks of the filter

    with your products and customers - I would create a table with the names in so that those can be used as a dropdown and validate on the data list that way - all your products and customer names will be entered with identical names and not run the risk of having

    12 pce Braai Pack Chicken
    12 piece Braai Pack Chicken
    12 pce Braai Pk Chicken

    in the data which, will be picked up as three separate items -

    OR are you the only one using the spreadsheet and theres no chance of that type of issue
    Attached Files Attached Files
    Last edited by etaf; 04-19-2013 at 07:37 AM.

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Help with SUMIF function and dates

    Try Pivot Table, refer the attached file for details
    Attached Files Attached Files


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  5. #5
    Registered User
    Join Date
    01-28-2013
    Location
    Manchester, England
    MS-Off Ver
    Excel 2003, Excel 2007, Excel 2010
    Posts
    50

    Re: Help with SUMIF function and dates

    Hi,

    This would be far easier to do using a Pivot table to be honest, especially as the monthly update would be to simply refresh the pivot table.
    However, looking at what you're trying to do.
    I'd use SUMIFS rather than SUMIF to use multiple criteria and also add a column to the datalist with a formula to regulate the invoice date to the 1st day of each month.

    See attached update of your doc to see what I mean.
    RB Sales Data Extract 2 - bodhi808.xlsm

    Chris

  6. #6
    Forum Contributor
    Join Date
    08-01-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2007
    Posts
    182

    Re: Help with SUMIF function and dates

    Please find attached the updated sheet.
    Attached Files Attached Files
    One must rise above the Clouds to see the Blue Sky rather than constantly trying to push them aside

    If you want to say Thank you to a member, click the little star * below.

    If your Problem is Solved, please mark the Thread as Solved

  7. #7
    Registered User
    Join Date
    04-19-2013
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Help with SUMIF function and dates

    Hi Guys, thanks for help. These are all great suggestions! You've saved me hours of work

+ 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