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 53. Total comments: 2055
I am trying to use the COUNTIFS formula
I want to count the numbers of different interest rates in one column and produce a result if it satisfies the criteria that it belongs to a field called MN (there are various other fields..
eg COUNTIFS(('PD11'!$H$8:$H$177,"<6%"),('PD11'!X8:X177,"=MN"))
Help!!
Hi Svetlana,
I have two strings FirstRow & LastRow defined as address ranges
How can I use CountIFS formula to count number of zeroes between these two ranges.
Hello Miss Svetlana Cheusheva,
I want ask you about How do I Sum or ets in one cell. I have 2 cell (A1)(A2), in cell one(A1) have number that I enterd, an other cell (A2) I have condition is that: if A11.000.000*3. It means between 2 Numbers that I imagin
I want function alike this: =if (A11.000.000;A1*3;"No Number")
Is there a way to count the number of instances in a column based on a criteria and then display the results not as a number, but as a list of data from the cells that meet the criteria?
Such as:
Lenovo User 1 Serial#
Lenovo Inventory Serial#
Apple Inventory Serial#
Apple User 2 Serial#
Apple Inventory Serial#
Microsoft User 3 Serial#
=COUNTIFS(A1:A6,"Apple",B1:B6,"Inventory")
But I would like to display the rows where the data meets these criteria, instead of the number of instances.
Desired display in a separate part of the spreadsheet, while not deleting the original cells.
Apple Inventory Serial#
Apple Inventory Serial#
Thank you very much for any assistance, positive or negative.
Timothy Scully
Hi i need to count values in a colum condicioned by another colum, just like a i have XX,YY and ZZ in colum A and Values in Colum B i need to say cout at colum B if at colum A is YY how can i do it? Need help
Hi There I wonder if you can help me with COUNTIFS for text Values:
I have NATIONALITY in row G, and TYPE OF VISA in row J,K,L,M,....(contains "1"/symbol "x" as value).
I use =COUNTIFS(G12:G117,"=NATIONALITY",J12:J117,"1",......) and it works.
now if i want to apply the formula to a new items, how is the fastest way to do that?
I am trying to count the number of Army in one column that is due to depart between a date range of 90 days in a separate column. I have tried =COUNTIF(I:I,="ARMY")+COUNTIF(Y:Y,">="&TODAY()+1)-COUNTIF(Y:Y,">"&TODAY()+90). I get the correct number for the dates in the range, but doesn't exclude Air Force, Marines, and Navy. I hope you can help. Thank you
This time with name...
Hi!
I need to be able to count the number of columns that have a date that is less than 11 days old. I understand I could do this using the Today() function, but it keeps hanging. I currently have =COUNTIFS(Infrastructure!$A$2:$A$2000,"Infrastructure",Infrastructure!$C$2:$C$2000,"<11"(&TODAY()-$C2)
Where infrastructure is the name of the tab to go to, the first criteria says if the cell is 'Infrastructure', then the problem is the last calculation. I want to count the number of occurences where today minus the date in cell c2 is less than 11. CAn you help?
Hi Jennifer,
If my understanding is correct, you need just need to tweak the formula a little bit:
=COUNTIFS(Infrastructure!$A$2:$A$2000,"Infrastructure",Infrastructure!$C$2:$C$2000,">="&(TODAY()-11))
I am trying to count the amount of cells that list "Baltimore" in column H and the Agents name in column F. So basically how many lines in a sheet that contain a name AND a particular client.
I tried =COUNTIF(Eval_Data!F:F,BRL_Agent_Summary!C4)+COUNTIF(Eval_Data!H:H,”Baltimore”)
I fount that this will count the agents name but every instance that agents name appears and also if Baltimore appears.
I also tried =COUNTIFS(Eval_Data!F:F,"C4",Eval_Data!H:H,”Baltimore")
But it isn't counting the cells I want. It is bringing back 0 when I know there is data. I'm not sure what is wrong.
Hi Joanna,
Try the following formula:
=COUNTIFS(Eval_Data!F:F,BRL_Agent_Summary!C4,Eval_Data!H:H,"Baltimore")
1202 13
1401 110
2107 121
1108 140
1111 154
1103 210
2102 812
2103 1103
1208 1104
1014 1105
1107 1111
1105 1154
2308 1204
1206 1210
n/a 1231
1154 1401
2305 2101
1306 2102
2101 2103
1204 2107
1201 2201
1210 2302
2302 2308
1104 (blank)
1106
2104
1301
1303
1402
2201
2309
1205
I have two column's of number.
Column1 is actual numbers
Column2 is numbers that have been input manually
I want to use a countif function to tell me how number in Column2 are not in Column1
Hi Richard,
The task requires creating a helper column, say Column C. enter the following formula in C1 and then drag it down to other cells:
=IF(AND($B1<>"",COUNTIF(A:A,$B1)=0), "Not in Column 1", "")
After that, you can use the below formula to count how many numbers in Column2 are not in Column1:
=COUNTIF(C:C, "Not in Column 1")
I am working on a spreadsheet with a basic countif formula thats working well for me. When I add a filter to the worksheet in column A and filter by one item (e.g Apple) the formula does not autmatically updated. Please help.
Hi Sham,
The point is that the COUNTIF function processes all cells within a specified rage, not only those that are visible at the moment.
Hi
I hope you can help me. I am trying this formula as follow.
=COUNTIFS('Sheet1'!$AV:$AV,""&"",'Sheet1'!$AR:$AR,"*Feb*") +
COUNTIFS('Sheet2'!$AV:$AV,""&"",'Sheet2'!$AN:$AN,"*Feb*")
I need to know contacts per month. If AV is not empty and AR in sheet1 / AN in sheet2 have a month, count it( they could be empty, so count only the ones that have months on them ). As simple as that.
It doesn't return any value when I use ""&"", or "*".
The format of both is "text" and the range as is the same.
It is not working and I can not see what I am doing wrong.
thank for helping!!
Hi Sara,
Here you go:
=COUNTIFS('Sheet1'!$AV:$AV, "<>"&"",'Sheet1'!$AR:$AR,"*Feb*") +
COUNTIFS('Sheet2'!$AV:$AV, "<>"&"",'Sheet2'!$AN:$AN,"*Feb*")
For more info about blanks /non-blanks, please see:
https://www.ablebits.com/office-addins-blog/excel-countif-function-examples/#countif-blank
Ah. no it didn't. Waste of time!!
Jamie,
Sorry for this, none of the blog engines we've tried is perfect.
As for the formula, you should not use cell addresses inside the quotes, otherwise Excel interprets them as mere text strings. For example, instead of "<=C1" you write "<="&C1.
Try the following formulas:
=COUNTIFS(C2:C9, ">=6/1/2014", C2:C9, C1)
=COUNTIFS(C2:C9, ">=6/1/2014", C2:C9, "<="&C1)
That last post missed a whole chunk of something I wrote so it now probably doesn't make sense...
I meant: From this
=COUNTIFS(C2:C9, ">=6/1/2014", C2:C9, "=C1","=C1","<=C3")
Hope that makes more sense and posts what I wrote.....
Hi, Looking at the COUNTIFS with multiple criteria for dates....
Is there an adjustment I can make to this formula.....
=COUNTIFS(C2:C9, ">=6/1/2014", C2:C9, "=C1","<=C2"
So, translation - "count everything here, that match this, between this date and that date".
I need this to make it more user friendly than expecting people to manually adjust a formula in a cell.
Either in the formula or with VBA?
Thanks!
Hi,
I have a spreadsheet i am trying to count how many times a value (i.e. 3) occurs within cells E8:G380 when the text value in column D is ABC. If I use: =COUNTIFS(D8:D380, "ABC", E8:G380, "3") it returns a value error. Excel also only allows me to use two countif or countifs functions per cell.
Any help is appreciated!
Thank you!
Hi Elodia,
All ranges of the COUNTIFS function must be of the same size, i.e. must have the same number of rows and columns. You can use the following formula instead:
=COUNTIFS(D8:D380, "ABC", E8:E380, "3")+ COUNTIFS(D8:D380, "ABC", F8:F380, "3")+ COUNTIFS(D8:D380, "ABC", G8:G380, "3")
Dear Sir/Mam,I wanna to count objects in different cells of the same row/col., I have try so many defferent formulas,but I fail to do so,Help me.
My Question is to add defferent cells of same row/col.
Example:- Count objects in C1,C5,C10,C15..........,there is no range like c1:c15,so plz help me.
i have 500 account number
how to search double
Col.A Col.B
1 A
2 B
3 C
4 A
5 D
6 C
7 A
8 B
9 D
I would like to extract from above table in a separate table like bellow the corresponding values with comma.
Col.B Col.A
A 1, 4, 7
B 2, 8
C 3, 6
D 5, 9
Thank you in advance!
dear team
my problem is tat a cell contains a value in general format as for eg; 2085 when i count using this countif formula the value does not get matched up and doesnt return 1 to me simply as zero
When i entered into that cell it contains some extra characters as space if i try to delete that space and put enter the last value i.e from "2085" 5 has been truncated and im left with 208
can u pls help me
let's say i have 200 names in column with some names repeated in the list. How can i get the count other than 2 specific name?
Is there not an easier formula to use to count all the cells within a column with a value that is a multiple of 5, other than:
=COUNTIF(X4:X41,5)+COUNTIF(X4:X41,10)+COUNTIF(X4:X41,15)
Listing every multiple of 5 is not even possible so surely there is another way??
PLEASE help if possible......somebody....anybody? -Thanks! :)
i want to count if enter one score (numbers) for one day for one employee and need to count if enter next whenever coming days that figure need to added
I am trying to count two criteria. One column is counting all "New" occurances if column two is equal to a range of 15 different zip codes. I know I can countifs (a2:a20,"NEw",....) but the second criteria is d2:d20,g1:g16. I have put G1:g16 in as an "or" condition but keep getting a "0" count. Basically I want the thing to countif a2:a20 is new and d2:d20 "is one of" several different numbers. I was trying to do it without a lengthy formula referencing each number in its own countifs formula. Can you help?
please advise how to use countif formula to use =COUNTIF(B6:B51, $A$54)/COUNTA(B6:B51)- every day i need to add one coloumn in B5. however it should automatically calculate this week as B5:B52, but B5 is not getting calculated.. Thankyou
A B C
1 Start Finish Days Open
2 12/10/2014 12/13/2014 3
3 12/15/2014 12/16/2014 2
4 12/16/2014
I am using =NETWORKDAYS(A2,B2) for days open
How can i modify the above formula so it will pickup Todays's date if there is no date in B5.
Can anybody help ASAP with that.........
Hi,
could you please advice, how to use formula if J8 contains multiple score with texts to be match with L8 (contains scoring 1,2,3). So I want if I choose/click J8 then L8 will displaying match score. Thank you
Hi,
How are you, please help me to my below problem.
Which formula should I use from multiple condition but value will be text.
For example: =SUMIFS(A:A,B:B,"Line",C:C,"Date")
result factor=205 (suppose).
But I want to the result "text", no "digit".
So, how will I get the result "in word".....
Please help me if you cooperated me.....
Thanks in advance
Hi i've been driven mad by excel today I hope you can help.
I'm trying to make a critera with COUNTIF statement before my SUM value kicks in.
As you can see the calculation works on anything less than 12 I'm trying to get cell K15 to stop counting after 12 unfortunatley K15 will have data larger than 12 so 12 would be capped if you like. is this possible?
=COUNTIF(K15,"<13")*SUM(J15/52*4,(J15/52*K15))
Any help would be appreciated
Hi there, I'm very sure my problem will be easily fixed by one of your Excel aficionados but I'm intermediate level at best. I have complied a huge roster. I had 6 dentists and we've just taken on another 2. In the past I have manually adjusted the surgery number up to our max of 6. This has now increased to a max of 8. Can I use a countif to calculate the number of surgeries in use using the Dentists initials as criteria and increasing in increments up to 8? Rather than entering these numbers manually and adjusting if someone goes on leave etc?
ie
1 TT 2 SL 3 AB 4 JM 5 TL 6 JD ?CB ?PD
Am I just overlooking the obvious, or is there just not an easier formula to use to count all the cells within a column with a value that is a multiple of 5, other than:
=COUNTIF(X4:X41,5)+COUNTIF(X4:X41,10)+COUNTIF(X4:X41,15)
Listing every multiple of 5 is not even possible so surely there is another way??
PLEASE PLEASE help - even if the answer is simply "no". -Thanks!
Hi There,
I would be deeply grateful if anyone can help me with my issues!!!
I am trying to set up my spreadsheet to enable me to calculate how many "1's" fall on the month of january.
E.G
Date Error Code(s)
01/01/2015 1
02/01/2015 1
03/01/2015 1
04/01/2015 1
05/01/2015 1
06/01/2015 1
07/01/2015 1
The idea is, I will have a break down of the error codes for each month!
I've been trying all sorts of COUNTIF formulas but have had no luck!
Please help, I'd be eternally thankful...
Dell kiran 200
Dell sameer 400
Dell kiran 300
Hp amol 200
Zenith mohsin 500
Dell =countif ans 3
I want to calculate the data based on column b but calculate data form d column.I want answer if there is three dell record I want count the data
from d column that answer Is three based on dell records.
which functions is use for calculation
please help me
Hi,
I am trying to make a spreadsheet that will count the number of times "A" happens between "B" occurrences. I am not really sure how to explain it so here is some info of what I am trying to accomplish.
B
null
null
null
A
B
A
A
null
A
null
A
B
So for the above data, I would like to count the number of times "A" appears between any given range of "B" values. So for the first two instances of "B" there would be "1" and for the range between the second and third instances of "B" there would be "4" and "null" would not be counted (they are blank cells).
Thank you for your help.
Luke
Hi i have a problem please help me to get out this problem
56 658 658
65 58 258
256 2 25
3 88 635
365 895 65
987 65 658
i want to count cell which have only two digit (example, 56,65,25 etc)
I trying to have excel calculate how many times I get as close as possible to 1 with out going over, within a column of numbers in my spread sheet? Can you please help. My column is about 40 cells in length and the unit of measurement I have are random.
Example numbers - These number will be changing more then once.
.22
.45
.67
.31
Etc.
I need the function to count the different condition in a single range. Like, In a single range numbers given 1,2,3,4,5,6,6. so, now i want to know in this range that how many numbers 1 to 3 are there.
example: 1,1,4,4,5,6,6. answer is 2. because in this condition 1 is two times repeating from 1 to 3 series and 6 is also 2 time repeting in 4-6 series.
Please help me.
I need to use a function to count the number of Part in column c2-c134 in the NWest which is in column f2-f134, I dont seem to be able to enter the correct data into any function to get it to do this
Thank you very much.. really it's very helpful
I want to use Countif formula to test the criteria range against a specific logic. In other words, If column A contains a date, and I want to count the cell if its date is within a certain week number. What I did is =COUNTIFS(Violations!A:A,WEEKNUM(Violations!A:A=WEEKNUM(TODAY())))
But it returned 0 values. Would you please check how can I do it?
I have a time keeping system that is putting a "'", an apostrophe, in a a group of cells. I am trying to count the number of people that are in a range, and unfortunately the range also contains the apostrophes in otherwise blank cells. So I need to subtract the number of cells that contain the apostrophes from total number of cells. The COUNTIF does not recognize the apostrophe, I assume because it thinks it is a character to treat the cell like text rather than a date, or number, etc. (the only work around). I cannot figure out a way to fix this other than "clearing" all of the cells of apostrophes, which is very time consuming and error prone. Any ideas?
Go for.. COUNTIFS (if not using using Excel2003)
You can add new condition to exclude "apostrophes" "'".
Please Help.
I have tree sets of data. Project Type, Resource Name and Days (columns Jan-14 to Dec-14).
Project Type being.. T1, T2, T3, T4, T5.
Resources X, Y, Z.....
Resource Allocation Days against each month... 17, 19, 11, 20, 20 as values
Now I need to calculate in a summary table.. Count of Months resources are allocated to a Project Type.
Can you please help me.
Hi Svetlana,
I have been following your posts and find them very helpful.
I just need help on something:
I have a running list surgical procedures for 2014.
Col A = date (running list)
Col B = Types of Procedure (Procedure A, Procedure B,...)
I want to count total number of procedures per month:
January - How many Procedure A, B, C, D...?
February - How many Procedure A, B, C, D... and so on.
Thank you.
I have following data sheets.
sheet1data
Branch Code Risk Number of high risk No of Risk Instances
0101 H 04 18
0102 M 11 20
0103 H 9 24
0104 L 5 13
0105 M 10 26
How I can fix formula that if branch code = 0101, check risk, count number of high risk and multiply number of risk instances
Formula that will continuesly count based on Cell value and number it sequencially
Col1
ab
cd
ef
ef
cd
ab
Result
ab-2014-01
ab-2014-02
cd-2014-01
cd-2014-02
ef-2014-01
ef-2014-02
HI there.
I'm not well versed in COUNTIF, but I think this is what I need but not sure how to go about creating a formula.
I have column with a $$ amounts in each cell and the corresponding column/cell would either be a Yes or No.
I need to create a grand total of all Yes' and a separate grand total for No's.
Can you help?
Thanks in advance.
Marcella
=countif(A:A,"yes")
=countif(A:A,"No")
A:A which area you want to range selection data if you want.
hi,
i have a excel sheet where many of products like 20p,6P,2D
and i want to sum of products in next sheet againts product when i filter any where in main product sheet
Hello Chandan,
I am sorry, I cannot follow you. If you can explain the task in more detail and provide a sample of your data, we'll try to help.
Hi Svetlana, I've read most of these question and can't find one with the same problem as I'm having. I have a range, for example A3:A9, and I want a result when another cell contains text from one of the cells in the range. For example if A3="cat", I want a result when, for example, C2="a cat on a mat". If the situation was reversed, and I wanted to know if the contents of a cell was contained in a range, I'd do =COUNTIF(A3:A9,"*"&C2&"*"), but I want to know if any cell in a range contains text in a cell. My problem is I can't use add anything, like a wildcard, to a range, so I can't do =COUNTIF("*"&A3:A9&"*";C2)
Is there a way to get this result?
Thanks
Ben
I have a document where one column has list of name (around 100). Then I have so many other columns which can have any one value from set of 5 values(val1,val2, val3, val4, val5).
Now I want to count number of val3 in row where name is Name12.
Now to make is dynamic I have created 2 cells
1. First to select Name (data validation = list)
2. Second to select val (data validation = list)
Now I want the next row to calculate total cell where value = value of second cell but from the row where name = value from first cell.
Hello Amit,
You need a VBA macro to fulfill this task. You can ask for it in special VBA sections on mrexcel.com or excelforum.com
HI
I PREPARED A WORKSHEET OF OUR EMPLOYEES TO CALCULATE SOME DATA SUCH AS THERE AGE AS ON DATE, DIVIDED THEIR AGE GROUPS ETC. BY GIVING DATE OF BIRTH. I CALCULATED THEIR AGE BY APPLYING =YEARFRAC(A1,TODAY(), 1) FORMULA. FURTHER I TRIED THEIR AGE BY DIFFERENT GROUPS SUCH AS 20-25, 26-30 ETC. FOR WHICH I APPLIED =COUNTIFS(C:C,"=CT",'G:G,">=21",G:G,"<=25"). BUT DID NOT SHOWING ACTUAL NUMBERS OF PERSONNEL COMES UNDER THAT CATEGORY IN SAID WORK SHEET. REQUEST HELP ME TO SOLVE THIS ISSUE.
S/N RANK NAME DATE OF BIRTH AGE AGE 21-25
1 CT MUNNA 18-06-1991 23 17
2 CT MITHUN 28-02-1991 24
3 CT BISWAJIT 26-06-1991 23
4 CT KARTICK 14-10-1989 25
5 CT SOURAV 22-10-1991 23
6 CT VIKASH 28-02-1991 24
7 CT VEERENDRA 03-01-1992 23
8 CT OM PRAKASH 01-07-1989 25
9 CT PAWAN 02-01-1990 25
10 CT SANJAY 09-01-1990 25
11 CT SUNIL 21-10-1990 24
12 CT Atanu 10-07-1991 23
13 CT KALI 05-02-1990 25
14 CT RAKESH 05-01-1991 24
15 CT SUNIL 09-02-1991 24
16 CT PUPINDER 12-12-1991 23
17 CT PATIL 23-11-1991 23
18 CT Gulab 10-07-1991 23
19 CT Bhupendra 18-12-1991 23
ACTUALLY ALL ARE COMES UNDER 21-25 AGE GROUP BUT SHOWING ONLY 17 NOS.
THANKING U
Hi Satheesh,
The correct formula is as follwos (F:F instead of G:G):
=COUNTIFS(C:C,"=CT",F:F,">=21",F:F,"<=25")
I am trying to count the number of occurrence of which the two certain conditions must be met. I tried it this way
COUNTIFS('Brgy Cases,other Agencies'!$C$11:$C$13,"*Alangan*",'Brgy Cases,other Agencies'!$V$11:$V$13,"*Those Issued*") + COUNTIFS('Brgy Cases,other Agencies'!$C$15:$C$17,"*Alangan*",'Brgy Cases,other Agencies'!$V$15:$V$17,"*Those Issued*") + COUNTIFS('Brgy Cases,other Agencies'!$C$19:$C$21,"*Alangan*",'Brgy Cases,other Agencies'!$V$19:$V$21,"*Those Issued*") + COUNTIFS('Brgy Cases,other Agencies'!$C$23:$C$24,"*Alangan*",'Brgy Cases,other Agencies'!$V$23:$V$24,"*Those Issued*") + COUNTIFS('Brgy Cases,other Agencies'!$C$26:$C$27,"*Alangan*",'Brgy Cases,other Agencies'!$V$26:$V$27,"*Those Issued*")
You can notice that there is 5 COUNTIFS function, and it's working fine. Unfortunately, when i am trying to add another set of countifs, the result returns a date format.
Is it because there is a limit for summing up the occurrence in COUNTIF limited only to 5?
Thank you.
Hi Michael,
A formula can contain up to 8192 characters, no matter how many COUNTIFS are used. Just change the format of the cell with the formula to Number.