+ Reply to Thread
Results 1 to 14 of 14

Problem with sumifs function

  1. #1
    Registered User
    Join Date
    04-10-2013
    Location
    Nottingham, England
    MS-Off Ver
    Excel 2003
    Posts
    39

    Problem with sumifs function

    Hello,
    I'm having problems with a sumifs function - could be something to do with the criteria for date syntax perhaps, summing total costs for each category of costs between 2 dates?

    range to sum cost_data = Cost_data!$F$1.$F$1000

    data range based on this cost data = Cost_data!$A$1.$A$1000

    1st date criteria = Cost_data!$A$1.$A$1000,">=&$G$2" - date in cell $G$2

    2nd date criteria = Cost_Data!$A$1.$A$1000,"<=&$G$3" - date in cell $G$3

    3rd criteria = Cost_Data!$C$1.$C$1000,B14 - based on the value in cell B14 - category of costs.

    Any help greatly appreciated!
    Last edited by Jonno1; 02-11-2014 at 08:13 AM.

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Problem with sumifs function

    Try

    =SUMIFS(Cost_data!$F$1:$F$1000,Cost_data!$A$1:$A$1000,">="&$G$2,Cost_Data!$A$1:$A$1000,"<="&$G$3,Cost_Data!$C$1:$C$1000,B14)

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

    Re: Problem with sumifs function

    you have " around the cells
    so
    ">=&$G$2"
    should be
    ">="&$G$2
    same on the other formulas
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  4. #4
    Registered User
    Join Date
    04-10-2013
    Location
    Nottingham, England
    MS-Off Ver
    Excel 2003
    Posts
    39

    Re: Problem with sumifs function

    Hello,
    Thanks for these suggestions, I've tried them in the new formula but with the second condition I get an error, excel highlights the following in the second condition in black/bold :

    "<="&$G$3

    when I try and input the criteria a second time with "<=&$G$3,

    I get a suggested amendment to:

    Cost_data!$A$1:$A$1000,">="&$G$2,Cost_Data!$A$1:$A$1000,""<=&$G$3

    I'm not too sure whats going on here? To be on the safe side, if the function still exists in excel 2010, I would use DSUM with a criteria box hidden away.

  5. #5
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Problem with sumifs function

    This works for me

    =SUMIFS(Cost_data!$F$1:$F$1000,Cost_data!$A$1:$A$1000,">="&$G$2,Cost_Data!$A$1:$A$1000,"<="&$G$3,Cost_Data!$C$1:$C$1000,B14)

    Can you post the actual formula you tried to enter?
    Or even better, post a sample book?

  6. #6
    Registered User
    Join Date
    04-10-2013
    Location
    Nottingham, England
    MS-Off Ver
    Excel 2003
    Posts
    39

    Re: Problem with sumifs function

    Hi, file attached, worksheet is 'profit and loss account', relevant column where all the sumifs formulas are is column D, dates are G1 and G2, expense categories in column B.
    Attached Files Attached Files

  7. #7
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Problem with sumifs function

    Formula must be:
    =SUMIFS(Cost_data!$F$2:$F$1000,Cost_data!$A$2:$A$1000,">="&$G$2,Cost_data!$A$2:$A$1000,"<="&$G$3,Cost_data!$C$2:$C$1000,B14)
    note two changes made.
    • Please remember to mark threads Solved with Thread Tools link at top of page.
    • Please use code tags when posting code: [code]Place your code here[/code]
    • Please read Forum Rules

  8. #8
    Registered User
    Join Date
    04-10-2013
    Location
    Nottingham, England
    MS-Off Ver
    Excel 2003
    Posts
    39

    Re: Problem with sumifs function

    Hi, thanks for the above, I had a quick look last night at the revised suggestions, dates seem to work ok, but with the final condition, should this be expressed in the formula as "B14"?

  9. #9
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Problem with sumifs function

    No because it is reference to a cell not to actual text "B14".

  10. #10
    Registered User
    Join Date
    04-10-2013
    Location
    Nottingham, England
    MS-Off Ver
    Excel 2003
    Posts
    39

    Re: Problem with sumifs function

    Hi, some progress with the above, the conditions relating to the dates now work OK, but I have totals of 22 and 44 for indexing & marketing respectively, in sheet 'Profit and loss' for the period 1st January 2014 to 31st January 2014. However, looking at the data in sheet 'cost_data' suggests that these costs for the period under consideration should be more.
    Attached Files Attached Files

  11. #11
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Problem with sumifs function

    Many of the dates in the cost data sheet are stored as text - you may see this because they align to left of column by default. You may convert to true dates by copying empty cell, then select date column and paste special, Values, Add.

  12. #12
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Problem with sumifs function

    Your dates in column A on the Cost_Data sheet, are not all really dates.
    Most of them are just text strings that look like dates.

    Try copying a blank cell, then highlight that whole column
    Right Click - Paste Special - Values - Add - OK

  13. #13
    Registered User
    Join Date
    04-10-2013
    Location
    Nottingham, England
    MS-Off Ver
    Excel 2003
    Posts
    39

    Re: Problem with sumifs function

    Thanks for this, I thought there would be something wrong with the date format as I did notice the difference in text alignments in the cell. The dates are entered via textboxes on a userform, I will now change the VBA code using Cdate function, and put the thread as 'solved' if this works.

  14. #14
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Problem with sumifs function

    You must always use CDate if you pass date from userform textbox to a worksheet!

+ 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. Sumifs problem
    By kim296 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-02-2013, 02:56 PM
  2. [SOLVED] Problem with Excel SUMIFS function
    By mbeurmann in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-04-2013, 04:45 PM
  3. [SOLVED] sumifs function to calculate dynamic range sum problem
    By xs2deepak in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 01-25-2013, 04:24 PM
  4. [SOLVED] Sumifs, problem with the formula: =sumifs(c10:c200,<=today(),0)
    By Faustocruz in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-08-2012, 04:26 AM
  5. Excel 2007 : SUMIFS problem
    By ThisIrksMe in forum Excel General
    Replies: 8
    Last Post: 08-27-2011, 07:15 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