The tutorial explains how to use COUNTIFS and COUNTIF formulas with multiple criteria in Excel. You will find a number of examples for different data types – numbers, dates, text, wildcard characters, non-blank cells and more. Continue reading
by Svetlana Cheusheva, updated on
The tutorial explains how to use COUNTIFS and COUNTIF formulas with multiple criteria in Excel. You will find a number of examples for different data types – numbers, dates, text, wildcard characters, non-blank cells and more. Continue reading
Comments page 12. Total comments: 2050
Alexander
Thank you for your help. Prior to requesting, I did look through the prior chats before requesting advice. Thank you for the formula provided. Initially the formula was not picking up any values, but was returning a 0. I tried substituting named ranges for the cell ranges in the provided formula and that did the trick.
=SUM(COUNTIFS(daterange, ">=01/01/2021",daterange, "<02/01/2021",schoolrange,{"school 1","school 2"},subjectrange,"art",projectstatusrange,{"finished","nearly finished"}))
Where daterange is the specified cell range for the dates, schoolrange is the specified cell range for school numbers, subjectrange is the cell range for the various subjects, and projectstatusrange is the cell range for the various project status’.
I appreciate your expertise and help. I use and reference your blog and find it to be one of the better and more responsive blogs.
Best regards-
Good day,
I’m struggling with a Countifs formula and could use your help.
I have two tabs-formula is in tab/sheet 1, data table is in tab/sheet 2.
I’m trying to determine the number of times one of two project status appear based on certain conditions:
On tab/sheet 2, the data is set up as follows:
Column 1 is School 1, School 2, School 3
Column 2 are the subjects: Art, math, science, language, etc…
Column 3 is the project status: not started, started, in process, nearly finished, finished
Column 4 is the date of the entry/status update
I am trying to write the a formula that accomplishes the following:
The number of projects between date range >=01/01/2021 to <02/01/2021 for just the the art classes from either school 1 or school 2 that are in either a “nearly finished” or “finished” status
I’ve tried using if(and combined with a count if, but I continue to get #value errors.
Any help is greatly appreciated.
Hi!
Have you tried the ways described in this blog post? I hope you have studied the recommendations in the tutorial above. It contains answers to your question.
Something like this formula:
=SUM(COUNTIFS(D2:D9, ">=01/01/2021", D2:D9, "<02/01/2021",A2:A9,{"school 1","school 2"},B2:B9,"art",C2:C9,{"finished","nearly finished"}))
I have to calculate child spaces for a month. I used S as sick. We allow 5 sick days per child per month to be counted towards compensation, anything over 5 days is not counted. The formula I used to count days for present was =COUNTIF($B11:$AF12,"P"). But I cant figure out the S days to minus the 5 allowable days. Any help would be greatly apprecied
Hi!
I’m not sure I got you right since the description you provided is not entirely clear. However, it seems to me that the formula below will work for you:
IF(COUNTIF($B11:$AF12,”S”)>5,5,COUNTIF($B11:$AF12,”S”))
If this is not what you wanted, please describe the problem in more detail.
Hey there,
I have a data sheet with columns indicating characteristics that are labelled with numbers to indicate which characteristic. 1: Black 2: Yellow 3: Brown 4: White 1: Cat 2: Dog
I would like to find out which cells in the spreadsheet have the two matching characteristics.
eg. "black" "dog" So, the end goal is to have 1 number added to the answer box for each person in the survey who owns a dog that is black.
=countif(Data!R1:R99, "2", Data!Q1:Q99, "1")
Would you care to tell me what is wrong about my formula?
Hello!
To count on multiple conditions, use the COUNTIFS function. Please read the above article carefully.
Thank you so much!
The different between plural and non plural is what was holding me back.
This has helped me immensely and I am happy that you responded promptly.
Hello There,
I have multiple columns, example:
Code ; Environment; value
xyz; Dev;1
xyz; SIT;1
xyz; PAT;1
ABC;DEV;1
PQR;PROD;1
Now, i need to take only values which has Dev and either SIT or PROD or PAT, flag them True. if it is just Dev only they flag them False.
Need your guidance. thank you
Hello!
You can use the IF function with multiple conditions. I cannot offer you a formula, since your conditions are incomprehensible to me. On the first line, both TRUE and FALSE are true. If not, give an example of the result you want.
Hi,
When using dates as the criteria arguments, do you have always specify in US date numerical format rather than UK equivalent?
I live in the UK and so the convention we use to convert 1st June 2015 to numerical format is "01/06/2015". In the USA this would be 06/01/2015.
Does excel functions only work with the later?
Thank you so much for this!
Hi, please help! I have 2 columns, Column A "Date" and B is status if "Passed/In Progress".
I need to count the number of "Passed" using a date range provided in a cell. Here's a sample:
COLUMN A. Column B. Column C. Column D Column E
10/1/2021 Passed 10/1/2021 10/30/2021 2
10/5/2021 In-Progress
10/10/2021. Passed
11/01/2021 Passed
Hello!
Please re-check the article above since it covers your task.
Here is one more article that may be helpful to you: COUNTIF formulas for dates.
I hope I answered your question. If something is still unclear, please feel free to ask.
My sample seems wrong didn't know spaces will be deleted after posting.
Column A "Date", Column B "Passed/InProgress", Column C and D "Date Range", Column E "Count Passed"
I need to know what formula am I going to use on Column E. Thank you so much!
I just found out the answer it's:
=COUNTIFS($B$2:$B$6,">="&$C$2,$B$2:$B$6,"<="&$D$2,$A$2:$A$6,"Passed")
Thanks!
Hi, I'm not sure how to put this in the formula and not even sure what function I need to use, can someone help me, please?
I have 2 sheets named and with column names below
Sheet 1 Name: Est Sheet (with data)
Column A: Facility Name (with data)
Column B: Department (with data)
Column C: Est Asset (with data)
Column D: Actual Asset (data needs to come from Sheet 2)
Sheet 2 Name: Asset Located
Column A: Asset Name
Column B: Facility Name
Column C: Department
I would like to pull out the total numbers of asset per facility and department from Sheet 2 and show it on Column D of Sheet 1.
How do I count the number of assets on each facility and department and pull out the sum to Column D of Sheet 1?
Help, please. Thank you!
Hello!
I kindly ask you to have a closer look at the article above.
Counting values according to two conditions:
=COUNTIFS(Sheet2!B2:B100,Sheet1!A2,Sheet2!C2:C100,Sheet1!B2)
can someone help me to get below result, count # of material based on two conditions.
detail
work order Date material
100 12-Oct ab
200 13-Oct cd
100 12-Oct ef
result
work order Date material
100 12-Oct 2
Hi!
You can use the formula
=COUNTIFS(A2:A100,100,B2:B100,DATE(2021,10,12))
If you need to calculate the unique values of materials, then I recommend the article: How to count unique values in Excel with criteria.
I hope my advice will help you solve your task.
I imported two separate reports into either same sheet or different sheets. Each report have in separate columns, b and ac, matching and unmatching number values. I need to identify a formula to return matching value from Report 1 (column b) Report 2(Column ac) to calculate total amount from Report 2 (Column ad if column b and column ac then match column e to column v and place total amount in column w) that matches the value from table array (column v match column e). As you can see below, in the table array (column v, data 3) matches from Report 1(column b, rev 3 and rev 7) with Report 2(Column ac, rev3) where the table array (data 3) calculates the total value to match all the criteria's of table 1 and table 2 and places the total amount from Report 2 (Column ad, $1.00 and $4.00). I hope this makes sense as this is difficult to explain.
Report 1 Table Array Return Value Report 2
Column b Column e Column v Column w Column ac Colum ad
rev1 Data1 data1 ($0.00) Rev3 $1.00
Rev2 Data6 data2 ($0.00) Rev4 $3.00
Rev3 Data3 data3 ($5.00) Rev5 $10.00
Rev4 Data4 data4 ($3.00) Rev7 $4.00
Rev5 Data2 data5 ($0.00) Rev10 $1.00
Rev6 Data1 data6 Rev12 $2.00
Rev7 Data3 data7 Rev15 $3.00
Hello!
Your request goes beyond the advice we provide on this blog. This is a complex solution that cannot be found with a single formula. If you have a specific question about the operation of a function or formula, I will try to answer it.
Hey,
I'm trying to use COUNTIF to look at 2 different collums and if both of the values are true to count, this is my formula but it is not working;
=COUNTIF('2021 Requests'!C6:C440, "Granted",'2021 Requests'!D4:D440,"07/01/2022")
Any help would be appreciated.
Needs to be COUNTFS not COUNTIF
also the range of C should be the same size as the range of D
so EX.
=COUNTIFS('2021 Requests'!C4:C440, "Granted",'2021 Requests'!D4:D440,"07/01/2022")
I have three colms
A B C
Loss amnt reason
Yes 100 Retrun
i have tried countifs( B1:B10,"<100",C1:C10,"return") but actual picture will be on the basis of Loss ( Yes or No). what is the formula for that.
Hi!
If you want to calculate the amount of losses, then use the SUMIFS function.
=SUM(COUNTIFS(D24,"*P*"),(COUNTIFS(D55,"*P*")),(COUNTIFS(D104,"*P*")))
I'M TRYING TO GET THE SUM OF DIFFERENT CELLS IN SAME COLUMN THAT IS MY SAMPLE FORMULA HOW CAN I SHORTEN IT IF I HAVE MORE THAN 20 LIST.. FOR THE FORMULA ABOVE THAT IS FOR MY FOREMAN THEY ARE "P" BECAUSE THEY ARE PRESENT I WANT TO COUNT THE PRESENT NO NEED FOR THE ABSENTS BUT MY HELPER IS 20 AND MORE I WANT TO TRY AND SHORTEN IT . I ALSO HAVE A FORMULA FOR MY 11 CARPENTERS
=SUM(COUNTIFS(D30,"*P*"),(COUNTIFS(D35,"*P*")),(COUNTIFS(D39,"*P*")),(COUNTIFS(D40,"*P*")),(COUNTIFS(D67,"*P*")),(COUNTIFS(D68,"*P*")),(COUNTIFS(D70,"*P*")),(COUNTIFS(D75,"*P*")),(COUNTIFS(D76,"*P*")),(COUNTIFS(D85,"*P*")),(COUNTIFS(D106,"*P*")))
IF YOU CAN HELP ME THAT WOULD BE A BIG HELP
TIA
Hello!
If your data is written in separate cells, you need to specify each cell separately. To reduce the formulas, you need to change the data table.
I did it by reading your article word by word haha thank you !
Thank you ! I did it by using countifs with multiple criteria
ANW I ALREADY GOT THE ANSWER TYVM <3
=COUNTIFS(D21:D118,"P",C21:C118,"CARPENTER")
Hello there! First I'm working on a spreadsheet where there are sometimes multiple rows for a single machine, and sometimes there is only one, I'm trying to get a function that works in a similar way to the countifs, but instead of resulting the number of cells it gives me the "name" or "address" of the cell, Example: =countifs(J61423:J61463;J61460; K61423:K61463;K61460) -> It results "2" but what I want is "(J61459; J61460)" which are the cells that I need.
Hello!
You can get the cell address using the ADDRESS function. You can find the examples and detailed instructions here.
For extra clarity: I'm asking if it is possible to do this by any function or mean, not necessarily using countifs, this function would simply work in a similar way to it. Is there something like that that I can use?
Can you please help? I am working from two tables. First table has a list of student group codes and the course department codes. The second table has a list of all the student names/their student group codes/course/department/course department codes, all in different columns. From table 2, I'm trying to do a count of total students in each student group codes in table 1 that shows up in each course department codes. Same student group code can belong to different dept codes.
Raw data is in Table 2 in different columns. Example of columns header below
Table 1
Stu_Grp Dept Dept Codes Dept
106100 2 Org_2200 Business
107100 2 Org_2201 Management
105100 4 Org_2400 Law
102100 6 Org_2600 Marketing
102200 8 Org_2800 Finance
104200 4 Org_2400 Law
104300 2 Org_2200 Business
104400 2 Org_2201 Management
105100 7 Org_2700 Accounting
Table 2
Student NameStud_Grp Dept 2 Codes Dept Description Dept 4 Codes Description Dept 6 Codes Descript
Hello!
Unfortunately, without seeing your data in Table 2, it is difficult to give you any advice. I think you need to use the COUNTIFS function. If you have specific questions about the formula, I will try to answer them.
Hello! I'm in need of a bit of help please :)
In my worksheet, I have a drop down list in row G10:CK10 for "Completed", "Ongoing", "Cancelled".
In the column G17:Y50, I have names of speakers, some of which are repeating names.
I would like to count the number of "Completed" events for each speaker. I have tried the COUNTIFS function, but unfortunately using the formula below it keeps returning as a VALUE error:
=COUNTIFs(G10:CK10, "Complete", G17:Y50, "Linda").
I would if you would be able to help?
Many thanks!
Hello!
You have different range sizes for the criterion and for the count, so the COUNTIFS function cannot be used.
If I got you right, the formula below will help you with your task:
=SUM(($B$10:$J$10="Complete")*($B17:$J50="Linda"))
I hope it’ll be helpful.
This is absolutely perfect! Thank you very much for your help!!
hello,
I need a little help :)
I have a excel file with some documents with bill ID and Dealer ID. I want to count number of dealer who has sold each product. Can you help me find a formula as detail below:
Date dealerID Bill Number Product ID Amount
23-03-21 68345307 21016501146004 5 1500
23-03-21 68345307 21016501146004 6 500
23-03-21 68345307 21016501146004 7 1000
23-03-21 68345307 21016501146004 8 1000
23-03-21 68345307 21016501146004 9 1000
24-03-21 963949731 21016601151003 0 100
24-03-21 963949731 21016601151003 2 100
24-03-21 963949731 21016601151003 5 100
24-03-21 963949731 21016601151003 7 100
24-03-21 963949731 21016601151003 9 100
25-03-21 99336636 21016701145002 0 2000
Product ID Total Amount No. Bill No. Dealer
0 2100 2 ?
1 0 0 ?
2 100 1 ?
3 0 0 ?
4 0 0 ?
5 1600 2 ?
6 500 1 ?
7 1100 2 ?
8 1000 1 ?
9 1100 2 ?
Hello!
I recommend using the information in this article: Count unique values with criteria.
The formula is something like this:
=IFERROR(ROWS(UNIQUE(FILTER(B2:B12,D2:D12=H2))), 0)
H2 -- Product ID
B2:B12 -- Dealer ID
Hi,
please see below, i have 2 columns, first one are the jobs working on, second column is phases in the job, how i can sum, count each phase for this job repeating in the column? different jobs may have same phases, so need phase column be dependant on job column... please help
job phase
3156 112
3156 541
3137 541
3156 99020
3156 99020
3137 541
3137 541
3156 99020
wip wip
Hi!
I do not quite understand what you want to calculate. How to calculate the number of phases for each job is described in this article above. If you need to calculate an amount with multiple conditions, use the SUMIFS function.
Hello, I've searched multiple threads and cannot find a combination that might help my scenario. I'm using COUNTIFS successfully. Ex. =COUNTIFS(A:A,"employee",C:C,"product") But how can I add a third criteria that counts ''repair order" only once if it is replicated? I think the correct term is 'Distinct'.
Here is a small sample where the result = 6
However Repair Order 206189150 is duplicated so the desired result is = 5
employee repair order product
318 206188973 ABLAST
318 206189055 ABLAST
318 206189150 ABLAST
318 206189150 ABLAST
318 206189160 ABLAST
318 206189188 ABLAST
I hope this is clear and I'm sorry about formatting.
Thanks in advance! - Craig
Hello!
I recommend reading this guides: Count unique rows in Excel and How to count unique values in Excel with criteria. Use a formula like this:
=ROWS(UNIQUE(FILTER(A1:C6,A1:A6=318)))
I hope it’ll be helpful.
Hi there,
second day in a row, sorry about that.
Is there a way to search across multiple sheets (i know that is a VLOOKUP) but to return values from the search?
In this case I have data from various cities, (all sheets are the same layout) and i want to look up the Sector (coloum D) for say "Construction" and return the total cost across all sheets (column F)
Hello!
If the “Construction” value is written in different positions on each sheet, then I recommend using the Consolidate Sheets tool.
You can use the SUMIF function for each sheet and then summarize the results.
Hi there, Im trying to return a result if one 'phrase' is met, and then one do have a difference result if one of 5 others.
I had a try but seem to have failed miserably with the second criteria/calculation
please help
IF(SUM(COUNTIF(E3,{"*In work as a result of LVP*"})),B3,""),(SUM(COUNTIF(E3,{"*In work through other means*","*Awaiting a start date*", "*Out of work*", "*Health Condition*", "*Other*"})),(B3-(B3*2)),"")
Hi,
if I understood the problem correctly, try this formula:
=IF(SUM(--ISNUMBER(SEARCH("In work as a result of LVP",E3))),B3, IF(SUM(--ISNUMBER(SEARCH({"In work through other means","Awaiting a start date", "Out of work","Health Condition","Other"},E3))), (B3-(B3*2)),""))
Hi there,, Thankyou SSOOO much, thats amazing
I am trying to use the Countifs to count the number of cells that fall within a specific date range and are between two values.
Example: If I want to know how many cells are between 40 and 60 (Cell E) and between the dates of 3/1/21 and 3/31/21 (Column A)
Formula I have been trying to get to work is
=COUNTIFS($A$4:$A$1000000, ">="&G5, $A$4:$A$1000000, "<="&H5,$E$4:$E$1000000, "&=40")
however, its returning over 27K as the count. I know I only have 1365 cells in this date range.
Any help would be appreciate.
Thanks
Hi!
Please use the following formula:
=COUNTIFS($A$4:$A$1000000, “>=”&G5, $A$4:$A$1000000, "<="&H5,$E$4:$E$1000000, ">="&40,$E$4:$E$1000000, "<="&60)
I have a need for a 3rd criteria. Using your example I would want it to countif Susan has a project, with a start date, but no end date. The example I am looking at is under "How to use COUNTIFS with wildcard characters".
Hi Bryan,
Simply, use 3 range/criteria pairs:
=COUNTIFS(B2:B10, "susan", C2:C10, "<>"&"", D2:D10,"")
if having a range of cells (D3:M37) where certain cells contain text: Yes, No, Maybe, how to return a result in another cell as the Yes or No or maybe correspond to a name in column B, for example, cell F3 has a NO the result (wanted to appear in P4) should be B3 name.
Hope this make sense
Thank you.
Hi, I've been stuck at this for hours.
I'm supposed to Input either a "Yes" or "No" or blank for 12 columns in a single row.
However I need a formula to Prioritize "NO" over the other answers.
But:
1. if there isn't "NO", but there's "YES" and blanks, then the cell should reflect "YES"
2. If there isn't "NO" or "YES", the cell should be blank
I tried Match and CountIF formula but i can't get the result i need.
Any help would be greatly appreciated!
Could you please help me
If in One Column I have Y 2,Y 1,Y 6, N3 is there a way that i can sum the Numbers only
Hello!
If I understand your task correctly, the following formula should work for you:
=SUM((IF(ISNUMBER(--MID(CONCATENATE(A1,A2,A3,A4),ROW($1:$100),1)),--MID(CONCATENATE(A1,A2,A3,A4),ROW($1:$100),1),"")))
or
=SUM((IF(ISNUMBER(--MID(CONCAT(A1:A4),ROW($1:$100),1)),--MID(CONCAT(A1:A4),ROW($1:$100),1),"")))
I hope it’ll be helpful.
Hi,
I've been spending days on getting the formula right, but still uncertain how to get the right info.
I've got two columns with different dates: Start Date (A) & Resignation Date (B).
Currently using =COUNTIFS(A3:A143, "=",B3:B143,"=>1-90" but doesn't seem to give the right answer.
I would like to calculate how many people are resigning within 3 months, between 3-6 months, between 6-12 months. Any idea how the formula will look like?
Thanks.
Hello!
To calculate how many people are resigning within 90 days, use the formula
=SUMPRODUCT(((B1:B15-A1:A15)<90)*((B1:B15-A1:A15)>0))
I hope it’ll be helpful.
Hi Alexander,
Thank you so much, this is definitely working!! :)
Regards,
Cindy
=SUM(COUNTIFS('SACE stg 2 2017'!F:F,OR('SACE stg 2 2017'!$F$1253,'SACE stg 2 2017'!$F$1256,'SACE stg 2 2017'!$F$1478,'SACE stg 2 2017'!$F$1484,'SACE stg 2 2017'!$F$1490,'SACE stg 2 2017'!$F$1495,'SACE stg 2 2017'!$F$1502),'SACE stg 2 2017'!G:G,'Lingustics subject'!A3), COUNTIFS('SACE stg 2 2017'!F:F,OR('SACE stg 2 2017'!$F$1253,'SACE stg 2 2017'!$F$1256,'SACE stg 2 2017'!$F$1478,'SACE stg 2 2017'!$F$1484,'SACE stg 2 2017'!$F$1490,'SACE stg 2 2017'!$F$1495,'SACE stg 2 2017'!$F$1502),'SACE stg 2 2017'!G:G,'SACE stg 2 2017'!$G$55))
This is my formula, I used the or statement to select a wide range of data that could include in a range, but it seems to didn't work. How can I fix this?
Hi!
It is very difficult to understand a formula that contains unique references to your workbook worksheets. Hence, I cannot check its work, sorry.
Hi,
I have following large set of data.
Catalogue Lot Count
HBI66545 1320000531 2
HBI66545 1320000531 2
HBI66545 1320000531 2
HBI66545 1319000101 2
HBI66545 1320000531 2
HBI66545 1320000531 2
HBI66545 1319000101 2
I have used this formula to count.
=SUM(B2=$B$2:$B$18,(1/COUNTIFS($A$2:$A$18,$A$2:$A$18,$B$2:$B$18,$B$2:$B$18,$C$2:$C$18,$C$2:$C$18)),0)
But my problem is I would need sum of Catalogue and Lot which should be 5 for 1320000531 and 2 for 1319000101. Could you help me solving this?
Thanks heaps
Hi!
Your explanations are not very clear. I am assuming that you want to count the number of occurrences of a value. For example 1320000531.
A simple COUNTIF formula is suitable for this, as described in this article.
If this is not what you wanted, please describe the problem in more detail.
How can I use CountIFs function while counting the data of specific individual for a specific range of dates. Example, I have list of names in column A (from A2 to A20), their daily working hours is between column C2 to AF20 (31 days). Now I want to calculate number of days each individual did less than 5 hours shift, number of days an individual was not present in that month, total working days etc. I know I can do all these calculations for each individual at the end of the last column but I am pulling this data at another sheet and the names may not be in same order.
Is there any other way other than CountIFs? Any help would be appreciated.
Hello!
To calculate the number of days with more than 5 working hours, you can use the formula
=SUMPRODUCT((Sheet1!$A$2:$A$20=$A$2)*(Sheet1!$C$2:$AF$20>5))
where cell A2 -- Name.
Please have a look at this article - Excel SUMPRODUCT function with formula examples
I have a spreadsheet that i want to return a count across a row if two conditions are met.
please whats the best way to write this code =if(AC3="Reject", AF3="vendor", Count(f3:Y3))
when i wrote this code, i noticed the ones that met the condition only returned "True" instead of counting across the row, see below.
Number of Rejects Due Supplier
1
TRUE
5
TRUE
TRUE
Hi!
If I understand your task correctly, the following formula should work for you:
=IF(AND(AC3="Reject", AF3="vendor"), COUNT(F3:Y3))
I hope it’ll be helpful.
Hello Alexander,
Yes this was helpful, but i like to have 0 for the once that didnt meet the condition instead of "false"
Actual expected
false 0
3 3
False 0
4 4
1 1
Hi!
I recommend reading how the IF function works and correcting the formula. It’s very simple.
Hi - i am trying to count the number of dates in a date range and using a countifs formula. Such as:
COUNTIFS(N:N,">="&B2,N:N,"<="&B3)
Where B2 refers to Start Date & B3 refers to end date (e.g. B2 = 01/04/2021 and B3= 30/04/2021)
It is calculating the dates but is not including the start(B2) and end date(B3) rather just the data greater to or less than the start(B2) and end dates(B3)
Do you know how to include the data for the dates noted in B2 and B3?
Thanks
Hello!
I used your formula and got no errors. Perhaps your dates in column N are written as date and time.
Hi , i am looking formula to rid of all the duplicates & the originals in comparision data . some duplicates starts with "."
Just example
Existing:
a123.com
.a123.com
Comparing with
a123.com
I need to remove all "a123.com" . i have sheet of of 10000+ in existing & comparing have "2000+" .
how to remove the duplicates even it have "." in starting .
i am using the formula of -=IF(COUNTIF(A:A,A2)=1,0,1). it detecting the exact duplicates but not catching any thing with "." in starting.
Hello!
If you need a partial text match, I recommend using this instruction: How to count cells with certain text (partial match).
I hope I answered your question. If you have any other questions, please don’t hesitate to ask.
Hi Alexander,
I'm trying to create a formula for this scenario. I have two columns, in each column there are only two texts that can be selected from a drop down (I'll call them "Text123" and TextABC"). I would like to create a formula that counts the total results for each for both columns, however, if "TEXT123" was selected in row 1 for both columns 1 & 2, I would only need to count it as one, not 2. How do I create a formula telling excel to count it only once per row, but for two columns total.
Thanks so much in advance.
Hello!
If I got you right, the formula below will help you with your task:
=SUM(--(A1:B10="TextABC"))+SUM(--(A1:B10="Text123"))-SUM(--(A1:A10&B1:B10="Text123Text123"))
Hi Alexander,
My spreadsheet is quite simple, it has 3 columns.
Column one has type of activity. (for ease of use, we can say Walk, Run & Swim)
Column 2 has only 2 options "1st Pass" or "Not 1st Pass".
Column 3 has a date.
I need to have a count depending on the month & year.
I can get each activity & whether its 1st pass or not 1st pass. Input is from Row 3 downwards.
My problem is when I am trying to choose month = 8 & year = 2021.
Formula just on basic Walk * 1st pass is =COUNTIFS(Applications!$A$3:$A$974,"Walk",Applications!$B$3:$B$974,"1st pass")
I have a table which splits each activity (rows) and months (columns). I would like to return the count of 1st pass walks in each month & year? I have used Month & Year function with SUMPRODUCT, but they seem to cause issues with COUNTIFS.
I was trying (year I am wanting to use is in C1 so I can change review previous years- in below formula looking for August in the year provided in cell C3):
=COUNTIFS(Applications!$A$3:$A$974,"Walk",Applications!$B$3:$B$974,"1st pass",Applications!$C$3:$C$974,MONTH(Applications!$C3:$C974)=8,Applications!$C$3:$C$974,YEAR(Applications!$C3:$C974)=$C$1)
Hello!
If I understand your task correctly, the following formula should work for you:
=SUMPRODUCT(--(A1:A10="Walk"),--(B1:B10="1st Pass"),--( YEAR(C1:C10)=2021),--( MONTH(C1:C10)=8))
If this is not what you wanted, please describe the problem in more detail.
Thanks Alexander,
I am looking to be able to return a result through countifs while searching for specific month & date within the range.
Just say date values fill up cells A1:A10.
How would I write a countifs formula searching for the month 8 (Aug) and year 2021?
Thank you for your review.
Hi!
The COUNTIFS function compares each value in a range against a criterion. You are comparing a date with a month number. Therefore, your COUNTIFS formula will not work.
Messed up down the bottom:
I was trying (year I am wanting to use is in C1 so I can change review previous years- in below formula looking for August in the year provided in cell C1):
Hello ,
Can u help me to set the below formula
=IF(B4:B30,"Purchase Invoice",COUNTIFS(K3:K30,"1-20"))
Thanks in advance
Hello!
The IF function does not work with ranges. Please describe your problem in more detail. It’ll help me understand it better and find a solution for you.
- C1 C2 C3 C4
R1 Apr-21 Apple 10 Delivered
R2 Apr-21 Bannana 15 Pending
R3 Apr-21 Oranges 23 Delivered
R4 May-21 Apple 12 Pending
R5 May-21 Apple 45 Delivered
R6 May-21 Bannana 27 Cancelled
R7 May-21 Oranges 24 Pending
R8 Jun-21 Apple 11 Cancelled
R9 Jun-21 Apple 10 in Transit
R10 Jun-21 Bannana 26 Cancelled
need to filter in c1 ( apr, june), then c2 (oranges, apple), then c4 (delivered, pending); the answer should be 2
I need countifs in single formula for above; please advise
Hello!
I believe the following formula will help you solve your task:
=SUMPRODUCT(--(MONTH(A1:A10)=4)+(--(MONTH(A1:A10)=6)),(--(B1:B10="Apple")+(--(B1:B10="Oranges"))),--(D1:D10="Delivered")+(--(D1:D10="Pending")))
You can learn more about SUMPRODUCT function in Excel in this article on our blog.
Question... I have 3 variables in 3 separate columns that I need to populate a Count for. Each variable needs to be true in order for the line to be counted. Each variable is a filtered/required criteria.
For Example--all variables need to be true in order to be counted:
Column A (Request Priority) Column B (Day) Column C (Hours of Operation)
Medium Sunday After Hours
Medium Sunday After Hours
Critical Thursday Standard Hours
Critical Thursday Early Hours
Criteria Counts
Medium, Sunday, After Hours = 2
Critical, Thursday, Standard Hours = 1
Critical, Thursday, Early Hours = 1
^Looking for a formula that provides the above output for about 400+ rows
Thanks so much!
Hello!
If I understand your task correctly, the following formula should work for you:
=COUNTIFS($A$2:$A$100,A2,$B$2:$B$100,B2,$C$2:$C$100,C2)
If this is not what you wanted, please describe the problem in more detail.
Thank you for your suggestion--unfortunately the formula isn't working. I'm pretty sure it is what I want, but it's only returning a value of "0" when it should be returning "1".
Does the fact that it's trying to count a cell that has a formula vs. a number/text affect it?
For example:
1. The cells/column containing the Day is a referencing a time an date stamp but formulated to only capture the day. So the formula sitting in the cell of column "CALCULATIONS!$AT:$AT" is actually "=CALCULATIONS!B:B" with formatting changes.
2. Also, the cells/column containing the Hours of Operation are also contain a sorting formula. "CALCULATIONS!$AX:$AX" is actually "=IF(AND(AW200>=TIMEVALUE("00:00:00"))*(AW200=TIMEVALUE("8:00:00"))*(AW200=TIMEVALUE("17:00:00"))*(AW200<=TIMEVALUE("23:59:59")),"After Hours","TBD")))" Where it then spits out the according values: "Early Hours" "Standard Hours" "After Hours".
Is there a way for Excel and/or Google Sheets to ignore the formulas and focus on the final value? I notice that when I override the formulas for both columns and just type in the value (Early Hours & Sunday) the calculation seems to work/count properly.
Hello!
I wrote this formula based on the description you provided in your original comment. Please note that if you’d provided me with a precise and detailed description of your task from the very beginning, I’d have created a different formula that would have worked for your case.
Excel works with values that are entered into cells or returned by formulas. If the cell contains a date, and you have set the custom date format "dddd", then in the cell you will see, for example, Monday. But in fact, it is a date and not a text.
I've tried the following formulas as well:
=SUM(COUNTIFS(CALCULATIONS!$AT:$AT, "Sunday", CALCULATIONS!$I:$I,"High", CALCULATIONS!$AX:$AX, "After Hours"))
=COUNTIFS(CALCULATIONS!AT:AT, "=Sunday", CALCULATIONS!$I:$I, "=High", CALCULATIONS!AX:AX, "=After Hours")
=COUNTIFS(CALCULATIONS!AT:AT,"Sunday",CALCULATIONS!I:I, "High", CALCULATIONS!AX:AX, "After Hours")
=COUNTIF(CALCULATIONS!AT:AT,"Sunday") + COUNTIF(CALCULATIONS!I:I,"High") + COUNTIF(CALCULATIONS!AX:AX,"After Hours")
^This last one produces 200+ values, so it's not what I'm looking for--it's counting them all individually instead of making them all a criteria of the equation.
Use a COUNTIFS formula to calculate Number of Product IDs by store location and product type
Product Category Product ID Store Location Sales Revenue
Apparel & Accessories 402850 Boston 17 $2,499
Apparel & Accessories 436987 Boston 98 $784
Apparel & Accessories 764613 Boston 51 $6,732
Apparel & Accessories 243484 Chicago 32 $3,072
Apparel & Accessories 522010 Chicago 171 $25,650
Apparel & Accessories 346155 Chicago 51 $3,876
Apparel & Accessories 181763 Chicago 118 $10,030
Apparel & Accessories 410456 New York 52 $2,340
Apparel & Accessories 454175 New York 30 $3,960
Consumer Electronics 426853 Boston 114 $4,446
Consumer Electronics 815098 Boston 49 $5,537
Consumer Electronics 209537 Boston 155 $21,390
Consumer Electronics 765870 Boston 101 $3,535
Consumer Electronics 747542 Chicago 149 $11,324
Consumer Electronics 177975 Chicago 119 $17,850
Consumer Electronics 840614 New York 97 $3,298
Consumer Electronics 271572 New York 127 $17,907
Consumer Electronics 367240 New York 104 $12,584
Consumer Electronics 791819 New York 91 $9,282
Hi!
I hope you have studied the recommendations in the tutorial above. It contains answers to your question
Hi, I am trying to count the number of times a two separate strings of text appear in a column that also fall between two dates. I can get it to work if only looking for one string of text but am unsure how to look for two or more.
For example in my 'D' column I am looking for the number of times the text 'S05' appears if it falls between the dates 01/04/2019 and 01/04/2020 in column 'F'. The formula I currently have for this is:
=COUNTIFS($D$10:$D$32981,"S05*",$F$10:$F$32981,">=01/04/2019",$F$10:$F$32981,"<01/04/2020")
This works but I'd also like it to count the number of times the text 'HINGED5' appears in column 'D' at the same time. Are you able to assist?
Hello!
If you want to use OR logic, try this formula
=COUNTIFS($D$10:$D$32981,"S05*",$F$10:$F$32981,">=01/04/2019",$F$10:$F$32981,"<01/04/2020") + COUNTIFS($D$10:$D$32981,"*HINGED5*",$F$10:$F$32981,">=01/04/2019",$F$10:$F$32981,"<01/04/2020")
If you want to use AND logic, try this formula
COUNTIFS($D$10:$D$32981,"S05*", $D$10:$D$32981,"*HINGED5*", $F$10:$F$32981,">=01/04/2019",$F$10:$F$32981,"<01/04/2020")
This is described in the article above.
Thank you. I did try that formula after reading the article the first time but couldn't get it to work so I must have mistyped something. This is working perfectly for me know, much appreciated.
Hi, I need to work out a formula for the following:
I have 5 rows with different info...
A1 = date, A2 = name, A3 = description, A4 = shop, A5 = amount.
Now I have to add the total spent for each name and for different expenses.
For instance, Sam has spent P500 on employment cost, P200 on production cost and P3000 on capital investment
Sarah has spent P1000 on employment cost, P200 on production cost and P3000 on capital investment.
Now I have to calculate only employment cost and production cost for Sarah and then seperately for Sam as well.
How do I go about? Please help.....
Regards
Hi!
Use the SUMIFS function. Here is the article that may be helpful to you: Excel SUMIFS and SUMIF with multiple criteria
I hope this will help.
I am trying to count cell-specific values using "in-cell dropdown". I am able to count each of these using the "countif" formula, but how can I assign a value to each. An example would be I have "green" with cell values of .5, 4, 1 & 8.5 and "yellow" with values of 1, 10 & 3.5. How can I add all of these numbers together, for each of the different in-cell options?
I hope this makes sense. I have a good basic knowledge of excel and have been trying to learn more.
Thank you!
Hello!
You can sum only values written in a cell. You cannot sum possible values from the drop-down list, since this is a formula.
Hello, i want to know if there is a formula that picks up first Column A is filled but Column B & C are Blank?
Thank you
Hi, I am trying to use the COUNTIFS function as below...
Column A "start date", I want it to count all dates before 01/04/2021 but then also count in Column B "end date" all dates after 01/04/2021, there are 5 in my test sheet but it's only pulling two when I use this formula =COUNTIFS(Participants!A:A, ""&"1/4/2021")
I need it to first count those who started before 1st April 2021 then out of those how many finished after 1st April 2021 - please help!
Hello!
If I understand your task correctly, the following formula should work for you:
=COUNTIFS(A1:A6,">"&"1/4/2021",B1:B6,"<"&"1/4/2021")
If this is not what you wanted, please describe the problem in more detail.
Hi!
Sorry the full formula didn't paste correctly in my first comment, the one you have suggested is the formula I have tried but for some reason it is only pulling 2 of the 5 entries that it should. I'm not sure where I'm going wrong. Thanks
Hi!
I can't see your details. Therefore my formula cannot work 100%. Change it for your data.
Hi
Novice here looking for help!
I’m looking to add up the total volume in column A of attributes in column B but only if column C contains the word scan.
A B C D
4 Apples Scan 1 Jan
4 Pears Scan 2 Feb
2 Apples 9 Feb
2 Apples Scan 17 March
1 Scan 21 March
So I’d end up with:
Apples = 6
Pears = 4
I also need the formulae to work if the table has been filtered. I have a column D with a date in it so if I filter the data to just show January dates for example it would have Apples = 4, Pear = 0.
Hope that all makes sense!
Thanks
Dave
Hello!
I believe the following formula will help you solve your task:
=SUMIFS(A1:A4,B1:B4,"apples",C1:C4,"scan")
I recommend reading this guide: Excel SUMIFS and SUMIF with multiple criteria and Excel SUMIFS date range formula - sum if between two dates
I hope I answered your question. If something is still unclear, please feel free to ask.
Hi - I am trying to create a COUNTIFS to give me a total count based on 5 criteria to be satisfied. 2 of my criteria includes counting how many rows have a value <0.1% , however the formula isnt working. It works however when i use a range 0.1%-1% for example. Is this because of the signs?
Hi!
Please specify which formula you mean and describe the problem in more detail
Hi Team,
My Question is the expected result count = 3 which is not coming with below Query.
=SUM(COUNTIFS($A2:$A11,{"Apples",Bananas"},$C2:$C11,{"Delivered","Pending"}))
Hello!
Pay attention to the following paragraph of the article above — How to count cells with multiple criteria (OR logic)
Hi,
I have a spreadsheet containing tasks and the percentage of completing each task, I am trying to get the number of tasks which 100% completed using function CountIFS as following
=COUNTIFS(B5:D47,"*leak test*",F5:F47,"=100%")
each time doing that I got error #VALUE! , So Could you Please Help, Note: leak test is a repeated task
thanks
Hello!
The ranges in which the COUNTIFS function checks for values must be the same size.
Change B5:D47 to B5:B47, C5:C47, В5:В47 .
Pay attention to the following paragraph of the article above — Count cells with multiple criteria (OR logic)
Good day! is it possible to count data in a single criteria with multiple data inputted in a cell?
Example:
Column 1: Gadget Ownership
Cell 1: Laptop, Desktop
Cell 2: Smartphone, Desktop
Hello!
I’m not sure I got you right since the description you provided is not entirely clear. However, it seems to me that the formula below will work for you:
=SUM(--ISNUMBER(SEARCH(D1,A1:A20,1)))
D1 - criteria