+ Reply to Thread
Results 1 to 14 of 14

Sum of Value meeting countifs criteria

  1. #1
    Registered User
    Join Date
    01-25-2017
    Location
    Fiji
    MS-Off Ver
    2013
    Posts
    21

    Exclamation Sum of Value meeting countifs criteria

    I have a table in Sheet1 with certain columns.
    Column K - Site
    Column M - Department
    Column N - Service affected

    I am using a countifs function to count according to certain criteria's. Below is a portion of the countifs i am using
    =COUNTIFS(Sheet1!$K:$K,"Lautoka",Sheet1!$M:$M,$A3,Sheet1!$L:$L,"*DDN*")+COUNTIFS(Sheet1!$K:$K,"Lautoka",Sheet1!$M:$M,$A3,Sheet1!$L:$L,"*IPC*")+COUNTIFS(Sheet1!$K:$K,"Lautoka",Sheet1!$M:$M,$A3,Sheet1!$L:$L,"*NGN*")

    Issue
    I am trying to add the value of one column where the row has been counted.

    i.e Assume Percentage is column Z
    cell A3 = FVDN

    Location Department Service Affected percentage
    Lautoka FVDN DDN 1%
    Lautoka IPC IPC 2%
    Suva FVDN DDN 2%
    Nadi FVDN ISM 5%
    Lautoka FVDN DDN 6%

    so if my countif crietria is if
    =COUNTIFS(Sheet1!$K:$K,"Lautoka",Sheet1!$M:$M,$A3,Sheet1!$L:$L,"*DDN*")+COUNTIFS(Sheet1!$K:$K,"Lautoka",Sheet1!$M:$M,$A3,Sheet1!$L:$L,"*IPC*")+COUNTIFS(Sheet1!$K:$K,"Lautoka",Sheet1!$M:$M,$A3,Sheet1!$L:$L,"*NGN*")

    only 2 of the rows meet the criteria so the result will show 2

    I want to add the values of the percentage column that met the countifs criteria. I.e 1% + 2% = 3%

    I tried the sumifs equation but not getting the correct answer

    SUMIFS($Z:$Z,Sheet1!$K:$K,"Lautoka",Sheet1!$M:$M,$A3,Sheet1!$L:$L,"*DDN*")+SUMIFS($Z:$Z,Sheet1!$K:$K,"Lautoka",Sheet1!$M:$M,$A3,Sheet1!$L:$L,"*IPC*")+SUMIFS($Z:$Z,Sheet1!$K:$K,"Lautoka",Sheet1!$M:$M,$A3,Sheet1!$L:$L,"*NGN*")

  2. #2
    Registered User
    Join Date
    12-17-2016
    Location
    South Wales
    MS-Off Ver
    Excel 2007, 2016
    Posts
    68

    Re: Sum of Value meeting countifs criteria

    Two things to check:
    Is your formula on Sheet1? If not, you need to add Sheet1! before $Z:$Z - as with the other elements of the formula.
    Does column Z contain numbers formatted as percentages, or just text that looks like a percentage? An easy way to tell is to enter a simple formula like =Z3+Z4 into a cell, and see if it gets you the expected result.

  3. #3
    Registered User
    Join Date
    01-25-2017
    Location
    Fiji
    MS-Off Ver
    2013
    Posts
    21

    Re: Sum of Value meeting countifs criteria

    Thanks for pointing that out. it should have been Sheet1!$D:$D.
    however it still does not give the correct value.
    the values in column D in sheet 1 is formatted to general values eg. 99.85624, 98.23111 etc

  4. #4
    Registered User
    Join Date
    07-13-2017
    Location
    INDIA
    MS-Off Ver
    2010
    Posts
    2

    Re: Sum of Value meeting countifs criteria

    Dear Joym, can you share the excel sheet which you are doing in it.

  5. #5
    Registered User
    Join Date
    01-25-2017
    Location
    Fiji
    MS-Off Ver
    2013
    Posts
    21

    Re: Sum of Value meeting countifs criteria

    I can not attach the file there is something wrong on da page

  6. #6
    Registered User
    Join Date
    12-17-2016
    Location
    South Wales
    MS-Off Ver
    Excel 2007, 2016
    Posts
    68

    Re: Sum of Value meeting countifs criteria

    Your formulas are three sumifs added together. Can you try each sumif separately to see if it gives what you would expect.

    It would be a lot easier if we could see the file. If you can't upload it directly to this site, could you upload it to a sharing site (e.g. Google drive or similar) and post the link here?

  7. #7
    Registered User
    Join Date
    01-25-2017
    Location
    Fiji
    MS-Off Ver
    2013
    Posts
    21

    Re: Sum of Value meeting countifs criteria

    Please find thge excel file at the link below
    https://drive.google.com/file/d/0B2H...ew?usp=sharing

    The Sumifs in Sheet2 column S
    the range for the Sumifs is sheet1!$D:$D ($z:$z was just used as an example)
    I actually want to calculate the average - ill divided the sumifs by the value in $F3
    =(SUMIFS($Z:$Z,Sheet1!$K:$K,"Lautoka",Sheet1!$M:$M,$A3,Sheet1!$L:$L,"*DDN*")+SUMIFS($Z:$Z,Sheet1!$K:$K,"Lautoka",Sheet1!$M:$M,$A3,Sheet1!$L:$L,"*IPC*")+SUMIFS($Z:$Z,Sheet1!$K:$K,"Lautoka",Sheet1!$M:$M,$A3,Sheet1!$L:$L,"*NGN*"))/$F3

    Would i be able to achieve this using Averageifs

  8. #8
    Registered User
    Join Date
    12-17-2016
    Location
    South Wales
    MS-Off Ver
    Excel 2007, 2016
    Posts
    68

    Re: Sum of Value meeting countifs criteria

    Averageif averages each individual range. Adding together three averages is different to taking a single average.

  9. #9
    Registered User
    Join Date
    01-25-2017
    Location
    Fiji
    MS-Off Ver
    2013
    Posts
    21

    Re: Sum of Value meeting countifs criteria

    Thanks for pointing that out. So my initial method was correct using the sumifs and the dividing by cell $F3 Where the Cell f3 conatins the count value for the criteria.

    Any help on why the Sumifs isnt working correctly

  10. #10
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,557

    Re: Sum of Value meeting countifs criteria

    The values in column D of Sheet 1 are text entries as opposed to numeric data.
    I downloaded the google file to excel, then I selected D2:D1489 and opened the 'text to columns' feature.
    I then selected the 'Next', 'Next' and 'Finish'
    The values all moved to the right side of the column and cells S5:S10 on Sheet 2 showed values other than zero.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  11. #11
    Registered User
    Join Date
    01-25-2017
    Location
    Fiji
    MS-Off Ver
    2013
    Posts
    21

    Re: Sum of Value meeting countifs criteria

    Thanks for the help it was very informative and actually did bring results.
    However there is something wrong. the number indicated in column F3 should correspond with number the a percentage value in O3.
    what i mean is since i used the same criteria for both but using the different functions the results should be related. So if column F3 has a count of 1 the value in O3 should be a minimum value of 87.xx as thats the minimum value in column D.

    can i also use this criteria to add anything that does not meet the criteria?

  12. #12
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,557

    Re: Sum of Value meeting countifs criteria

    I am Assuming that the percentage being referenced is in S3.
    Select cell F3 and run the Evaluate Formula feature which shows that the '1' in cell F3 is generated by the segment ...+COUNTIFS(Sheet1!$K:$K,"Nasinu",Sheet1!$M:$M,$A3,Sheet1!$L:$L,"*SDH*")...
    Using the filter buttons applied to columns K (Nasinu) and M (Access) the table on sheet 1, it can be deduced that the row where that occurs is 606 and there is no value in column D of that row.
    Let us know if you have any questions.

  13. #13
    Registered User
    Join Date
    01-25-2017
    Location
    Fiji
    MS-Off Ver
    2013
    Posts
    21

    Re: Sum of Value meeting countifs criteria

    thank you that was very helpful. there is one more thing i would like to achieve. I need to sum everything that does not fit the initial criteria. Is there a way this can be achieved. I have tried researching on this but could not find a simple solution other than writing a new criteria.

  14. #14
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,800

    Re: Sum of Value meeting countifs criteria

    Sum the whole lot and then subtract the value of your cell with the criteria formula in it from the total. So if A1 contains your big formula, this:

    =SUM($Z:$Z)-A1
    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.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    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] Index and Two Match Criteria- meeting both criteria (need help to repair formula)
    By OilAndGasMan1984 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-27-2017, 10:56 PM
  2. [SOLVED] Delete not meeting criteria, criteria in column another sheet (Filter)
    By marreco in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-10-2016, 07:32 AM
  3. [SOLVED] Count Data Meeting Criteria Across Columns Meeting Criteria
    By idelta in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-06-2015, 03:53 PM
  4. [SOLVED] Average(ifs) meeting certain criteria
    By B7Des in forum Excel General
    Replies: 12
    Last Post: 07-30-2014, 07:28 AM
  5. [SOLVED] SUMPRODUCT or COUNTIFS to Return Sum of Numbers Meeting Year and Part Number?
    By d_striker in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-27-2013, 04:01 PM
  6. Sum cells in a row meeting criteria
    By Murrayk in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-24-2012, 01:51 AM
  7. Replies: 6
    Last Post: 06-10-2012, 11:13 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