+ Reply to Thread
Results 1 to 8 of 8

ISSUES with SUMIFS

  1. #1
    Forum Contributor
    Join Date
    05-01-2018
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    117

    ISSUES with SUMIFS

    Hello All

    I got simple issue with SUMIFS function ...
    I'm trying to get sum of values if values from the list do not equal to criteria

    in Cell F8 I applied formula as below however it calculates as criteria are (OR) not (AND)

    =SUMIFS($C$3:$C$58, $A$3:$A$58, "<>"&$G$4, $B$3:$B$58, "<>"&$G$5)

    what I'm looking for is to sum values providing that both criteria are met at the same time (AND) which means sum should exclude only one cell (C58) as this cell meets criteria so i should receive value: 977,729.32
    now excel gives me value 925,031.39 which is sum of all values from column B with 2020 in it (excluding 2021) and top of that value from cell C7 is deducted (=as this cell meets one of the criteria) which means at the moment excel sums values from range C3:C54 and deducts value from cell C7 and I need values from cells C3:C57 as last cell meets both criteria

    Can you please advise where is the issue or what should be changed or maybe some other formula should be used?
    I'm confused

    thank you
    Attached Files Attached Files
    Last edited by adsako; 01-29-2021 at 05:52 AM.

  2. #2
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: ISSUES with SUMIFS

    to sum as an and it will exclude if either condition is not met
    a7=5
    and the last 4 values are 2021 so it performs correctly

    =SUM($C$3:$C$58)-SUMIFS($C$3:$C$58, $A$3:$A$58, $G$4, $B$3:$B$58, $G$5)

    gives the answer you require

  3. #3
    Forum Contributor
    Join Date
    05-01-2018
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    117

    Re: ISSUES with SUMIFS

    Hi
    thank you for that

    can you please advise how to calculate average for the same range

    I got official excel table which changes each week which means next week I will have values with CW6 etc ... and I need to exclude from calculation all values that are before CW5 in year 2021.
    what I would like to get as average is average of values from CW up to CW5 (so after two week I would need to exclude CW6 and CW7 as well)

    as the example: how can I calculate average up to CW39 and make sure that excel will only calculate average up to CW39 and will not include into calculation CW40, 41, etc?

    hope that make sense ...

    thanks in advance for solution

  4. #4
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: ISSUES with SUMIFS

    I think you need to explain as it is not so clear, will you be excluding CW5 still? You are wanting an average for 2020 or 2021?
    Is it always from calendar week 5 or will this vary?
    You are currently talking about data that is not in the attachment?

    perhaps something along the lines of
    =AVERAGE(OFFSET(C1,LOOKUP(2,1/(A1:A100=5)*(B1:B100=2020),ROW(A1:A100)),0,100,1))

    you can specify your range by finding the position of the first and last values and perform the calculation on the data in between

    or is it always the most recent 52 weeks of data?
    Last edited by davsth; 01-28-2021 at 08:47 AM.

  5. #5
    Forum Contributor
    Join Date
    05-01-2018
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    117

    Re: ISSUES with SUMIFS

    Hi
    sorry for confusing ...

    basically my file is automatically updating and each week I got another line added to the file and what I want to is to exclude from average calculation all values that are meeting criteria
    for instance if criteria are:
    CW: less than CW 49
    Year: 2020
    I need to calculate all values in the rage till CW49 year 2020 and exclude all what is after CW49 year 2020

    however in case my criteria are:
    CW less than 3
    Year 2021
    I need to calculate average up to CW 3 Year 2021 but also include all what is in the past meaning in year 2020

    Basically I need to take into account only these values that are up to certain CW (defined as criteria) and exclude everything what is after that CW

    so if my criteria is CW 4 I want to calculate average up to CW 4 (all above) but exclude all what is after CW 4.
    problem is that file has CW 4 twice - in 2020 and 2021

    hope that make sense

    thanks
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: ISSUES with SUMIFS

    You are leaving too many gaps Is the range always continuous in your sheet? If so the below should work and be ok if you dont to have too many other calculations

    It find the first value(beginning year and week) and the row it appears on, and does likewise for the second value (end year and week)

    It uses this to create a range between them, then works out the average of the range
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    05-01-2018
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    117

    Re: ISSUES with SUMIFS

    Hi
    thanks

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,651

    Re: ISSUES with SUMIFS

    I have moved your new query to a new thread.
    Last edited by AliGW; 01-29-2021 at 06:17 AM.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

+ 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] SUMIFS issues
    By Weaselwithagun in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-27-2020, 10:42 AM
  2. [SOLVED] Sumifs and sumproduct sumrange issues
    By stuart010 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 02-29-2016, 06:07 PM
  3. Issues with INDIRECT and SUMIFS
    By dchubbock in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-25-2015, 09:25 AM
  4. [SOLVED] Advice needed - SUMIFS/SUMPRODUCT Issues
    By mo4391 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-23-2015, 02:35 PM
  5. [SOLVED] SUMIFS Issues
    By wat in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 02-15-2015, 03:26 PM
  6. Does SUMIFS have issues with merged cells or across multiple sheets??
    By dumaser88 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-09-2014, 01:04 PM
  7. SUMIFS formula with date format issues
    By swanseaexcel in forum Excel General
    Replies: 4
    Last Post: 04-18-2011, 05:25 AM

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