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 52. Total comments: 2055
How to count the number of values in a cells separated with a coma.
eg.
1
4,5
6
The number of values should be 4 in the 3 cells. Count function only counts 2 values.
Please use this array formula (press Ctrl+Shift+Enter to complete it):
=SUM(LEN(A2:A10)-LEN(SUBSTITUTE(A2:A10,",",""))+1)
Where A2:A10 is your cells with data. Please note that the formula will return wrong results, if your cells contain some text, e.g. "1,text,text20"
Hi,I Am making a file for my poject.I am facing the some problem in xls pls do help in that. I have to add the farmula that How may rows is on Time and Early only for NAGAR as given the example. total should be come in one cell for both On time+Early of the NAGAR name.
NAGAR On Time
RPRAD Early
BBIAD Late
CCUBG Late
NAGAR On Time
RPRAD Late
BBIAD Late
CCUBG Late
NAGAR Early
RPRAD Early
BBIAD Early
CCUBG Early
NAGAR On Time
RPRAD Early
BBIAD Late
CCUBG Late
NAGAR Early
RPRAD On Time
BBIAD Late
CCUBG Late
NAGAR On Time
RPRAD Late
BBIAD Late
CCUBG Late
Thank you.
Please use
=countifs(A2:A1000, "NAGAR", B2:B1000, "On Time") + countifs(A2:A1000, "NAGAR", B2:B1000, "Early")
Grate. Thank You.....
Thanks Svetlana, you just saved my life and a lot of typing :) awesome post
1 JAMES SHJ MALE MALE FEMALE KIDS
2 RICKY DXB MALE SHJ Formula ? Formula ? Formula ? 7
3CHRISTINA SHJ FEMALE DXB Formula ? Formula ? Formula ? 2
4 LIBA SHJ KIDS AUH Formula ? Formula ? Formula ? 2
5 JOSEPH AUH MALE 11
6 ZARINA SHJ FEMALE
7 WINSTON DXB MALE
8 JENNIFER SHJ FEMALE
9 MINNU SHJ KIDS
10 ARASH AUH MALE
11 MAHIR SHJ MALE
uum yeah, that was very clear how's going to Dubai and sharjah I suppose?
Hello Eddie,
I am sorry, your data look distorted in the comment. For us to be able to assist you better, please post a small sample workbook with your data on our forums and describe in detail what you want to count. We will try to help.
I've been reading around and I apologize if I've missed this(the information has me a bit...confused and I overwhelmed)
I am trying to keep track of some projects between me and a person.
Under one column of cells I have the type of project and in another I have who did it.
I have somewhere a list of how many of each TYPE of project is done and beside that who it was done by so I can keep track of the giant project list.
So say...the C columne says "Project type 1" or "Project type 2" and the D column has "Done by Susy" or "Done by Dave"
I was keeping track of "Project type 1" in one cell. So it's counting how many we did of that type very well.
Then I did the same for Project type 2.
But when I got to the point of: "Project type 1 done by Susy", I tried to put in a formula to count how many times Project1 was done by Susy and another counting how many times it was done by Dave.
...cept it doesnt work. And I'm not quite sure how to do it. I got confused reading the information because it seems to always be consistent info in different columns or different info in the same column and rarely did I find "Only count if both these conditions are met"
Is that..even possible? Neither have value numbers. They use words rather than numbers(obviously they arent actually called 'Project 1' and '2'.
Gah..just writing gets me confused.
Hello, i thank you for helping others unconditionally. I have asked for help and posted twice. Number 177 is the only one i can find. I understand that you have extremely high traffic volumne. But i was just wondering if i am able to get help here or even my request for help is misssed. thank you again for the good works you are doing for all persons and society.
I'm trying to calculate the total number of individuals who meet a certain criteria, but I can't seem to make the "COUNTIFS" formula fit what need. I have a column, EDU and here is some sample data. I want all data to count as 1 except "HS" which should not be counted. The purpose is to calculate the number of individuals who have post-HS education.
Do you have suggestions on how to make the formula work with multiple conditions?
EDU
HS
BA
BS
AA
AS
HS
HS
BA
AA
Hello Shannon,
Please use the following formula:
=COUNTA(A2:A20)-COUNTIF(A2:A20,"HS")
Where A2:A10 is the EDU column
Hi! For my previous question I get answer! But I have other one - if I want to count only "OK" results for IF function for example H7:H19, what function do I need to use?
=IF(C7>0;"OK";"BAD") this one is working, but if I put region
=IF(C7:G7>0;"OK";"BAD")or =IF((C7:G7)>0;"OK";"BAD") excel give me VALUE
Hi,
I'm trying to get excel to find numbers ending in a 7 (i.e. 47, 57, 67) and then need to tell the computer is raise the number to 47 to 50, 57 to 60 and 67 to 70. Please can someone help please?
Thanks
Sue
Hi Svetlana,
I hope you may be able to help?1?
I am designing an attendance spreadsheet for a school using a set of alphabetic codes for attendance, for example - P- Attended, L - Half day, A - Absent.
I also have a summary box for reporting purposes and need to count attendance and absence based on gender (M/F) and grade(k - 10) and ethic background (I,NI) (a column for each).
Therefore I need to count the number of Ps, or A's that exists in the attendance data in the row IF gender=M and grade=K and ethnicity=I
I also want a value returned if the cell is still empty.
I am have tried using : =COUNT(IF((C6:C19="K")*(E6:E19="M"),F6:BM19="P"))
But this returns will a nil value.
Let me know if I need to send through the spreadsheet.
Thanks in anticipation.
Jessie
Warm regards,
Jessie
DATE Service sum(totalHits) sum(Successful) sum(Dispatched) sum(Failed)
11/1/2014 MPESA Uploader 373 285 =COUNTIF:(sheet1:status1,"<=103", sheet1:status1,"<=202")
11/2/2014 MPESA Uploader 227 158 1
11/3/2014 MPESA Uploader 285 284 1
11/4/2014 MPESA Uploader 294 294 0
11/5/2014 MPESA Uploader 301 301 0
11/6/2014 MPESA Uploader 253 251 2
11/7/2014 MPESA Uploader 274 273 1
11/8/2014 MPESA Uploader 283 281 2
11/9/2014 MPESA Uploader 2 2 0
11/10/2014 MPESA Uploader 268 268 0
11/11/2014 MPESA Uploader 7 7 0
11/12/2014 MPESA Uploader 58 57 1
11/13/2014 MPESA Uploader 243 243 0
11/14/2014 MPESA Uploader 195 195 0
11/15/2014 MPESA Uploader 259 259 0
11/16/2014 MPESA Uploader 299 296 3
11/17/2014 MPESA Uploader 291 289 2
11/18/2014 MPESA Uploader 342 342 0
11/19/2014 MPESA Uploader 335 335 0
11/20/2014 MPESA Uploader 394 393 1
11/21/2014 MPESA Uploader 304 302 2
11/22/2014 MPESA Uploader 295 295 0
11/23/2014 MPESA Uploader 308 308 0
11/24/2014 MPESA Uploader 625 617 8
11/25/2014 MPESA Uploader 361 361 0
11/26/2014 MPESA Uploader 295 295 0
11/27/2014 MPESA Uploader 356 356 0
11/28/2014 MPESA Uploader 262 262 0
11/29/2014 MPESA Uploader 227 227 0
11/30/2014 MPESA Uploader 358 358 0
I need to compute the sum failed
Hi,
Can you send me the sample excel, how to calculate & I need the count of net working day
Example: In a monthly if I used to get "n" number if volumes... I want to calculate the ageing.... But I don't want to calculate Saturday & Sunday...
Can you support me to get the the format sample through mail
=NETWORKDAYS.INTL(I6,I36)
I6 - Start Date
I36 - End Date
Auto Show How many date working
Hi any one can help me on the following
Peter 02/01/15
Hari. 05/01/15
Sam. 12/01/15
Peter. 13/01/15
=countifs(a:a,Peter, b:b,"="&today-3) but I suppose to get 1 ryt if today date is 13/01/15??
I have a problem regarding counting multiple criteria and the problem is counting only the "year" my data date like 29/05/2014.
=COUNTIFS('Rabbit Inventory'!$F:$F;"Buck";'Rabbit Inventory'!$E:$E;$AG5;'Rabbit Inventory'!$Q:$Q;"Purchased"; 'Rabbit Inventory'!$R:$R;YEAR(2014))
Hi, Firstly, I thank you for providing this excellent service. You are doing a great service.
I need some help with this. I want to send/link cells or rows or columns to another worksheet/book when the columns meet certain criteria.
For example, if the date and time attended in column D and E is later than a day or 10 hours compared to column B and C, and link those data that match criteria to another sheet.
Thank you and hope to hear from you soon.
Regards.
Joseph
Hi Svetlana,
Please help me get a formula for my query..
In an excel sheet having 3 columns- 'Date', 'Time' & 'Amount'. I need a formula which will add only those amount in the 'Amount' column, where the Date is from A to B & Time between and equal to C & D.
Please can you help me.?
Just to add to above query, A & B are 2 different dates, and C is a time in A & D is a time in B.
Hi,
please help me count the same value from different cells in the same row. The cells I need to be able to choose.
What I need to calculate is the attendance for each student but on two different occasions. So I will have to choose every second cell and thus it can't be a range.
Sun. Dec 21 Mon. Dec 22 Tues. Dec 23 Wed Dec 24 Thurs. Dec 25 Attendance
RW CS RW CS RW CS RW CS RW CS
P P P A A A P P P P 0
P P P P P P P P A A 8
As you can see, it is Communication Skills and Reading and Writing Skills that the student attends on two different times.
I tried
=COUNTIFS(D8,"=P",F8,"=P",H8,"=P",J8,"=P", L8,"=P")
and many other formulas with no success.
Svetlana Cheusheva you are so beautiful
Thanks for Guide.
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!