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 5. Total comments: 2074
I need to write a fomula that counts the UPC codes that were used in Las Vegas. There is a mixture of blanks and with letters. Here is a similar example:
Location UPC Codes
Las Vegas 981
Los Angeles 8989
Tokyo 9867
Las Vegas 8989
Los Angeles 8989
Tokyo
New York 65464
Miami Pi757
Las Vegas
Los Angeles 8989
Tokyo 2165
New York
Miami 235
Las Vegas 8989
Los Angeles G192
Tokyo Pi757
New York 8989
Miami 8989
Hi! Please check out this article to learn how to count unique values in Excel: with criteria, ignoring blanks.
Try to use this formula:
=IFERROR(ROWS(UNIQUE(FILTER(B2:B20,A2:A20="Las Vegas"))), 0)
I need to identify the presence of an element in at least one column, in columns that are separated from each other, but I need to count it just once (even if it is in several columns).
For example, in column A I have attendance on day X; in column D I have the attendance for day Y and in column H I have the attendance for day Z. Each day is marked "Yes" or "No".
I need to count the people who attended, regardless of whether they went 1, 2 or 3 times. When using the countifs function, if the person was not there on a day, it doesn't count them. On the other hand, if I combine the countifs function and add what is derived from the Or function, then it counts it 1, 2, or 3 instead of 1. Is there a way to do it?
Hello! Try to follow the recommendations from this article: How to count unique values in Excel with criteria
I believe the following formula will help you solve your task:
=COUNTA(UNIQUE(FILTER(A1:A10, (B1:B10="Yes")+(C1:C10="Yes")+(D1:D10="Yes"))))
DATE SALESMAN PRODUCTION HORECA
01-Oct-23 KOUSHAL JOSHI FOLLOW UP
01-Oct-23 NEERAJ PARIHAR CLOSED
01-Oct-23 RAFIQ SHEIKH FOLLOW UP FOLLOW UP
01-Oct-23 KOUSHAL JOSHI FOLLOW UP FOLLOW UP
01-Oct-23 NEERAJ PARIHAR CLOSED CLOSED
06-Oct-23 RAFIQ SHEIKH FOLLOW UP
06-Oct-23 KOUSHAL JOSHI FOLLOW UP FOLLOW UP
06-Oct-23 RAFIQ SHEIKH CLOSED CLOSED
09-Oct-23 NEERAJ PARIHAR FOLLOW UP FOLLOW UP
10-Oct-23 KOUSHAL JOSHI FOLLOW UP FOLLOW UP
10-Oct-23 NEERAJ PARIHAR CLOSED CLOSED
10-Oct-23 RAFIQ SHEIKH FOLLOW UP
13-Oct-23 KOUSHAL JOSHI FOLLOW UP FOLLOW UP
14-Oct-23 NEERAJ PARIHAR CLOSED CLOSED
15-Oct-23 RAFIQ SHEIKH FOLLOW UP FOLLOW UP
15-Oct-23 KOUSHAL JOSHI FOLLOW UP FOLLOW UP
15-Oct-23 NEERAJ PARIHAR CLOSED CLOSED
15-Oct-23 RAFIQ SHEIKH FOLLOW UP FOLLOW UP
Need to know that which sales man has generated how many leads in production and HORECA on daily basis. Required daywise report
Hi! I can't guess what result you wanted to get. Please provide me with an example of the expected result.
Hi, i have a question about a seemingly simple function but i cannot get it figured out.
So this is the formula i have
=COUNTIFS(I:I,"",D:D,"DEPO",B:B,"2024FA")+COUNTIFS(J:J,"86",D:D,"DEPO",B:B,"2024FA")
Now, the context is that i need to count a person whether they have either any value in Column I, or a value of 86 in Column J as well as the criteria for columns D and B staying the same. People CAN have both values present. The way the formula is written now, if someone has both values present, they are counted twice.
Am i missing something? I thought of using an OR function, but i cannot get that to work. Anyone have any insight into this?
Thank you!
Hello! Subtract the number of people who have both values present. Try the formula:
=COUNTIFS(I:I,"",D:D,"DEPO",B:B,"2024FA")+COUNTIFS(J:J,"86",D:D,"DEPO",B:B,"2024FA") - COUNTIFS(I:I,"",J:J,"86",D:D,"DEPO",B:B,"2024FA")
Hi! I'm trying to count a range of cells across a large array; *if* they match the criteria in a single column,
so, my first through was; It should be as simple as
=COUNTIF(B3:B123, "A Shift", F3:HH123, "Assigned"),
now; if i'm understanding correctly; the the vertical range must be the same size;
Is failing because the horizontal range is larger?
If so; what's the solution to simply find
if x=a in a single vertical column, count how many occurrences on the horizontal =b
I've tried
=IF(B3:B123=A, COUNTIF(F3:HH123, "Assigned"),0) and that wants to spill to nearby cells;
What am I missing here?
Hi! If I understand your task correctly, to count the number of values across multiple criteria, try using the SUMPRODUCT function. Here is an example formula:
=SUMPRODUCT((B3:B20="A Shift")*(F3:M20="Assigned"))
I hope it’ll be helpful.
Thanks for the speedy reply;
Unfortunately that example is returning 0
For what i'm trying to do, I have Column B which is just "A", "B", and "C" about 20 times each as we go down the rows from 3 to 123;
Then I have a matrix going across all the way from Column F to Column HH,
Some of the cells have dates in to indicate when a task completed; and some contain just the word "Assigned";
I'd like to count how many occurances of "Assigned" appear across the range where column B="A", then once that's working follow on for rows where Column B="B" and where Column B="C"
I originally used
=COUNTIFS('Primary Matrix'!F3:T30,"*Assigned*") to count the rows where Column B="A"
but this would mean that someone will have to manually adjust the formula whenever a new person is added to the range where B="A"
So rather i'd like to create a formula that will sum all occurrences of "Assigned" between Columns F and HH; only IF column B="A"
So i've tried your example like this, and I can see how it should work;
=SUMPRODUCT((B3:B123="A")*(F3:HH123="*Assigned*"))
But it returned 0 across a range that does contain multiple occurences of "Assigned", and I feel like i'm missing something obvious; but I can't work out what.
Hi! The formula I sent to you was created based on the description you provided in your first request. However, as far as I can see from your second comment, your task is now different from the original one.
To learn how to find a partial text match, please read: How to find substring in Excel.
For example:
(ISNUMBER(SEARCH("Assigned",F3:HH123)))
Hi,
I'll give that a go;
Apologies if it was unclear; the task has always been: count number of "*Assigned*" in a range; only where column B (outside of that range)="A*", and ignore other instances (within the range) of "*Assigned*"
Hi! If I understand correctly, use the FILTER function to get the range to count the "Assigned" values.
=SUMPRODUCT(--(FILTER(F3:M120,B3:B120="A")="Assigned"))
So, I've found a workaround;
I wanted to avoid adding any additional columns to the page with the data;
but by doing a single column with just
=COUNTIF(F3:HC3,"*Assigned*")
after the final data column; then all I had to do was (on the page I wanted to display the data)
=SUMIF('Primary Matrix'!B:B,"A*",'Primary Matrix'!HF:HF)
and likewise for B, and C.
that's solved it; not how I wanted to solve it; but it unarguably works now.
*A single column, with that COUNTIF repeated for each row of data.
=COUNTIFS('Section 2'!$AC:$AC,"Pending",'Section 2'!$AA:$AA,">12 months")
I am trying the above formula to get the number of cases pending beyond 12 months, as per my data sheet the result of this formula should be 0. however, the formula is returning a value i.e. 1 in first instance & 2 in second instance.
When I removed the > sign, I got the desired result. Also, when I tried adding >12 months in my data sheet as a dummy value to test the formula, it did not return the correct number. why is that so?
Hi! I can't check your formula because I don't have your data. However, your formula counts the number of text values, not dates. I recommend reading this guide: COUNTIF formulas for dates.
I am trying to incorporate the today function into my countifs formula. I have a column that reflects the date of activity but I can't seem to get it right.
=COUNTIFS(Master_TTHU_Inventory!$H$2:H$5000, A4,Master_TTHU_Inventory!$G$2:$G$5000,"MISSION READY")
The above formula is for my grand total report, but I need to show daily totals for cob that day on a separate sheet using the same information.
Hi! Create a column with dates on a separate sheet. Then add a condition for the date to the COUNTIFS formula. For example:
=COUNTIFS(Master_TTHU_Inventory!$H$2:H$5000, A4,Master_TTHU_Inventory!$G$2:$G$5000,"MISSION READY", Master_TTHU_Inventory!$D$2:$D$5000,New_Sheet!D2)
D - column with dates.
You can get a report without formulas, using a pivot table with grouping by days. Read more: How to make and use Pivot Table in Excel.
I hope it’ll be helpful. If something is still unclear, please feel free to ask.
I appreciate a lot to the information provided above. We are learning. However, I am still not clear on something I dont know which formula works best for the following example.
A B C
Month Dept Service Requested
1 Jan-23 Sales 0001
2 Jan-23 Sales 0001
3 Jan-23 Sales 0001
4 Jan-23 Operations 0001
5 Jan-23 Accounts 0002
6 Jan-23 Operations 0002
7 Jan-23 Accounts 0002
8 Jan-23 Admin 0003
9 Feb-23 Accounts 0004
10 Feb-23 Sales 0004
11 Mar-23 Accounts 0005
12 Mar-23 Operations 0006
13 Mar-23 Sales 0007
14 Mar-23 Operations 0008
15 Apr-23 Admin 0009
16 Apr-23 Admin 0010
17 May-23 Admin 0011
I want to count "how many service types were requested by each department per month". This means the formula has to count the similar service type once for same dept in the same month right.
Hi! If I understand your task correctly, the following tutorial should help: Count unique values with multiple criteria. For example,
=IFERROR(ROWS(UNIQUE(FILTER(B1:B20, (MONTH(A1:A20)=1)* (C1:C20="0001")))), 0)
I am using this formula and it is generating an incorrect value. =COUNTIFS('Tray Audit Log'!D:D, "Y",'Tray Audit Log'!B:B,">6/1/2023") - COUNTIFS('Tray Audit Log'!B:B,"<6/30/2023"). The data is counting 641 when there are actually 194 yes in the month of June.
I am trying to count the total y(yes) from one column and the MONTH from another column all information on a different tab. I can send the data via email I cannot attach it to this chat.
Hi! If you want to calculate June data, use the dates of May 31 and July 1 in your formula.
I want to compare multiple dates for Planning dates vs. Actual dates; it seems that in planning dates there are several activities inclusion same with actual dates. I need to compare it 1 by 1 activity date and the true values will determine the condition of green, amber and red.
Hi! Please clarify your specific problem or provide additional information to understand what you need. Give an example of the source data and the expected result.
Any way please to get the function criteria at countifs from a cell with multiple values into a criteria like {"A,", "B", "C") automatically?
A B D E
Item1 London PART DEPOT
Item1 London Item1 Frankfurt
Item2 London Item2 Hong Kong
Item1 Heathrow Item1 London
Item2 Manchester Item1 London, Manchester
Item1 Sandwell Item2 London, Manchester, Glasgow
Item1 Glasgow
Item2 Glasgow
Item3 Frankfurt
For example I need a =sum(countifs(A:A,D6,B:B, {"London", "Manchester","Glasgow"}) next to E6.
E6 is London, Manchester, Glasgow separated by comma.
any quick way to write the function so I can reference this cell but in a way it turns into {"London", "Manchester","Glasgow"} within the function instead of me typing it out?
Unfortunately, the COUNTIFS function does not work with array formulas. You can write an array of values directly in a formula, but you cannot pass an array of values to a COUNTIFS formula using another function.
Can we use countifs in MS Excel with in different online sheets...
Hi! If I understand your task correctly, this article may be helpful: Excel reference to another sheet or workbook (external reference).
Hello,
I have tried using one of your formulas but I might have an incorrect understanding of it.
I am trying to count multiple criteria (frequency of the word "CVD" tagged to "Antipolo DC")
I try to use this formula =COUNTIFS(N3:N2028,"Antipolo DC",Y3:Y1048576,"CVD") but the results show #Value!
May I kindly check what I am possibly doing wrong?
Please note that Antipolo DC is a location (there are 20 other locations in the list) and CVD is an option (there are 5 other options in the list)
Hi! I have said many times on this blog that the sizes of all ranges (that is, the number of rows and columns) in the COUNTIFS and SUMIFS functions should be the same.
Hi,
I am wanting to know if there is a formula on excel that would give me employees working at a given period per day. For example - there is a total of 20 people working at the facility but they all start and finish at different times. I want to know how many people are working from 9am to 10am etc etc. hope this makes sense.
Thanks
Hi! The answer to your question can be found in this paragraph of the article above: How to count numbers between 2 specified numbers. Count the number of values greater than the start time and less than the end time. I can't offer you a formula as I don't have your data.
Hello, I cannot figure out what formula to use for this problem. Referring to the data set below... Let's say column A is an employee number and I need to count all of the Ns for that employee, how would I write that formula? The other issue is the number of rows for each employee will not always be the same. For example, employee 1260 may have 7 rows, employee 1266 may have 12 rows, employee 1279 may have 15 rows.... so the range will always be different. The next issue is that the spreadsheet has 115311 rows so I cannot individualize each formula with the employee number or range. The formula would need to find each unique employee, establish the range and then count the number of Ns or Ps or whatever within that range. I was trying the =countifs formula trying to get it to use whatever number is in A1 as Criteria1, then giving the next range and asking it to count the Ns. =COUNTIFS($A2:$A115311,"=A2", C2:I27,"N") ..... this formula did not work. LOL
Not picky if it is displayed on a separate sheet. If its easier, it could put the report on a separate sheet which would list the unique employee number followed by how many Ns, Ps, 7s, As, etc.
1260 4/2/2023 N N N N 7 N N
1260 4/9/2023 N 7 N P N N N
1260 4/16/2023 N N N N N A Q
1260 4/23/2023 A P N N N A N
1260 4/30/2023 7 N N A A A Q
1266 5/7/2023 N N A N N N N
1266 5/14/2023 N N A A P 7 N
1266 5/21/2023 N P N A A A Q
1266 5/28/2023 N N N N N N N
1266 6/4/2023 N N N A A Q N
Thank you for any help you could offer!
Hi! Read the instructions above carefully. Also note that all ranges in the COUNTIFS function must have the same size, i.e. the same number of rows and columns.
A need Help for All Apples count and only show Delivered Percentage
if i use this code "=COUNTIFS($A$2:$A$11, "Apples", $C$2:$C$11,"Delivered")" its show (Apples Delivered 3) . if i had total 10 Apples and Delivered only 3 it will show Apples Delivered 30 %.
Hi! You can learn how to correctly calculate the percentage in this article: How to calculate percentage in Excel.
Please check the formula below, it should work for you:
=COUNTIFS($A$2:$A$11, "Apples", $C$2:$C$11,"Delivered")/COUNTIFS($A$2:$A$11, "Apples")
Thanks for the information.
I would like to count the number of unique value based on a set of "OR" & "AND" criteria.
Given the following,
A 3366 1 0
A 3329 1 1
B 2282 1 1
B 2282 1 1
B 2282 0 1
B 3409 1 0
To count the number of unique value of column B with following criteria: column A = "B" AND column C = 1, I could get the answer with
={SUM(IF((A1:A6="B")*(C1:C6=1),1/COUNTIFS(A1:A6,"B",C1:C6,1,B1:B6,B1:B6)))}
How to add an "OR" condition to the criteria for this?
say I would like to count the number of unique value of column B with the following criteria: column A = "B" AND ((column C = 1) or (column D = 1))
of course apart from generating a new column E to do the logic.
Thank you.
Hi! We have special tutorials that can help to solve your problem: How to count unique values in Excel and Count unique values with criteria. I hope it’ll be helpful.
I'm wondering if it's possible to count selected cell with conditional formatting with a date. counting the following
A5 + A8 +A10
each cell draws information using lookup formulas and conditional formatting
A5 = date (01/05/24)
A8 = date (26/09/22)
A10 = Txt (not trained)
= number of cells greater then TODAY()
this example = 1
Hi! I recommend reading this guide: COUNTIF formulas for dates.
Or try to use this formula:
=(A5>TODAY())+(A8>TODAY())
Hello all, this is a fantastic site, I've learned so much, can't tell you! OK, I can't seem to figure out how to do this, it seems simple, I must be missing something.
I want to count cells that have certain text strings within the cell that has a whole bunch of words in it. So let's say I've got a whole bunch of cells that contain sentences like this:
Mary went to the store to get apples
James went to the store to get oranges
James went to the store to get apples
etc., etc.
I want a formula that will count how many cells contain both "Mary" and "apples". I've tried the following, but they don't work:
=COUNTIFS($A$1:$A$10,*Mary*,$A$1:$A$10,*apples*)
=COUNTIFS($A$1:$A$10,"Mary",$A$1:$A$10,"apples")
Do I need to use the AND statement? Or maybe there's an issue searching for the words in the cell?
Thanks all.
Tom
Add quotation marks to the text string. Try this formula:
=COUNTIFS($A$1:$A$10,"*Mary*",$A$1:$A$10,"*apples*")
Please have a look at this guide: How to find substring in Excel. For example:
=SUMPRODUCT(ISNUMBER(SEARCH("apple",A1:A10)) * ISNUMBER(SEARCH("mary",A1:A10)))
I hope it’ll be helpful.
This is perfect, thank you so much for replying, much appreciated!
Tom
This formula counts 5 occurrences of 'X' or more than 5 'X' as 1 and it also does not count lower case 'x' and it is good. But, how can I modify this so that it will not count interrupted appearance of 'X' in a row but only unbroken 5 'X' or XXXXX? Broken and interrupted is like this ( XXXX X, XXX__XX and others) =SUM(IF(MMULT(--(EXACT(F8:AK39, "X")), TRANSPOSE(COLUMN(F8:AK39)^0)) >= 5, 1, 0))
Hi! Your formula is not working for me. If I understand the problem correctly, try this formula:
=SUM(--ISNUMBER(FIND("XXXXX",F8:AK39)))
For more information, please visit: How to find substring in Excel
=COUNTIFS('Sheet1'!$C$2:$C$29586,">="&'Safety Event'!C$1,'Sheet1'!$E$2:$E$29586,"=Near Miss*",'Sheet1'!$BP$2:$BP$29586,"SSS 05:00*",'Sheet1'!$C$2:$C$29586,"<="&'Safety Event'!C$2)
Can you add more on top of "SSS 05:00*"? I have to add more 6 items to count. or can we just slot a table range instead?
To count lets say from July 2, 2023 (C1) to July 8, 2023 (C2) to count ---- if Column E2:E9586 is showing a text Near Miss* miss and column BP is showing the text SSS 05:00* ( I want to add more shift aside from SSS 05:00)
Not really a comment although I loved the info and was able to use it in a spreadsheet I keep active with a group of 9 golfers and therein lies my question...
I have been trying for over a month now to auto copy data in a column of cells to another column, next to it. The data in the first column changes frequently, sometimes 4-5 times a week. What I need to do is copy the data in the first column into the second column before the first column is overwritten by the data entered on any given day. It's a small table that tracks a golfers drives (distance on each hole). I am trying to keep track of their last 5 rounds but can't figure out how to shift everything over 1 column before the new data overwrites in the first column. HELP!!!!
Hi, Needed help using the COUNTIFS formula with conditions, essentially I want to be able to count the number of times any initials from the data below features in the data set below, based on the region, month and if it is H&S/Commercial. I.e I want to be able to count the number of times text appears in May for H&S, for the North Planned region and similarly the number of times text appears in May-23 for Commercial. The list of names that will appear is roughly 11-12 (I can use a wildcard for the total times text appears for that particular month but can't get it to work when trying to get it for just H&S/Commercial:
May-23
Week Commencing 01-May-23 08-May-23 15-May-23 22-May-23 29-May-23
H&S Commercial H&S Commercial H&S Commercial H&S Commercial H&S Commercial
Region Contract
North Planned Guinness - PM LH
Wrexham - Voids SR
Wakefield - External Works PCSA Stage
Sheffield City Council - Sheffield Adaptations
Leeds CC - Back to Backs
St Leger - Towers
Oldham - PFI
St Leger - New Capital Framework
Kirklees Lot 1
Sheffield High Rise
FCHO
Guinness SHDF
Incommunities
Guinness SHDF Wave 2
Places for People
Together Housing
SCC Acquisitions
Hi! Unfortunately, based on your description, I can't understand what you want to count. To calculate values for multiple criteria, you can use the COUNTIFS function as described in the article above. You can also use the SUMPRODUCT function and these instructions: Conditionally count / sum / average cells with multiple criteria.
Or explain the problem in more detail.
Last attempt at this.
Sorry for the spam, but this message system is posting stuff I'm not typing and not posting stuff I am.
I have a datasheet and then a stats sheet, I'm trying to populate the Stats sheet automatically from data entered into the data sheets based on a monthly period.
Jan, Feb, Mar etc.
My formula is a COUNTIFs which first checks outcome column for the word "Positive NR" then it checks the Date Column for dates ">=" and "="&Data!A1,'[SS Stats 2023.xlsx]2023'!$A:$A,"<="&Data!A2)
Yeah its done it again. Cannot send you my formula, but believe me the ones which are working and the ones which doesn't are identical other than the "Positive" and "Positive NR", so cannot work it out.
Hi! Study carefully the last paragraph in the article above. Here is an example of the formula:
=COUNTIFS($I:$I,"Positive",$A:$A,">="&A1) - COUNTIFS($I:$I,"Positive", $A:$A,">="&A2)
Hi,
I'm trying to create a spreadsheet for work which will calculate the statistics for each month throughout the year based on another spreadsheet we use to hold all the data.
So we have a column with received date, a column with District and another column with an outcome.
What I'm trying to do with limited success is Check "Date Received" column for any dates within each month, then check another column with those dates which matches 1 of 5 words added to that column.
Example 1:
Column A - Check for all Cells with Dates between and including 01/01/2023 to 31/01/2023.
Column C - Check for all Cells with Text containing exactly "POSITIVE".
Below my Formula (I have a separate datasheet hidden on the workbook which contains all my month dates).
=COUNTIFS('[SS Stats 2023.xlsx]2023'!$I:$I,"Positive",'[SS Stats 2023.xlsx]2023'!$A:$A,">="&Data!A1,'[SS Stats 2023.xlsx]2023'!$A:$A,"="&Data!A1,'[SS Stats 2023.xlsx]2023'!$A:$A,"="&Data!A23,'[SS Stats 2023.xlsx]2023'!$A:$A,"="&Data!A1,'[SS Stats 2023.xlsx]2023'!$A:$A,"<="&Data!A2)
Any assistance on this would be great, as its driving me up the wall right now, it should work and I cant see why it doesn't :(
Hi! Pay attention to the last paragraph of the article above: Count dates with multiple criteria. Count the values where the dates are greater than the start date, subtract the values where the dates are greater than the end date.
Welp same issue again.
=COUNTIFS('[SS Stats 2023.xlsx]2023'!$I:$I,"Positive",'[SS Stats 2023.xlsx]2023'!$A:$A,">="&Data!A1,'[SS Stats 2023.xlsx]2023'!$A:$A,"="&Data!A1,'[SS Stats 2023.xlsx]2023'!$A:$A,"="&Data!A23,'[SS Stats 2023.xlsx]2023'!$A:$A,"="&Data!A1,'[SS Stats 2023.xlsx]2023'!$A:$A,"<="&Data!A2)
Ok I give up, it wont let me post my message or any variation of it, and all it does is make it look like my formula is massively wrong when the above formula has some "=" statements inbetween the ">=" and "<=" statements. I dont know how to fix it.
I'm trying to do =COUNTIF(B:B, C:C-9) and it's not working.
How do i get around this?
Hi! I don't really understand what you want to calculate. But the arguments to the COUNTIF and COUNTIFS functions cannot be formulas. They can only be values or cell references. Read the article above carefully.
Hi
I am trying to write a count if formula to count between two dollar figures...which appear
C4-DB4 is a run of varying $ amounts
DE4 is the max value (FORMULA)
DD4 is 10% less than max value (FORMULA)
=COUNTIFS(C4:DB4,">=DE4", C4:DB4,"<=DD4")
The above forumla wont count the number of $ values between max and 10% discount. Please help!
Hi! If I understand your task correctly, try the following formula:
=SUMPRODUCT((C4:DB4>=DE4*0.9)*(C4:DB4<=DE4))
For more information, read Excel SUMPRODUCT function with multiple criteria.
Hello,
I'm trying to write a formula that uses data from different cells based on where today's date falls within a date range. This is what I have:
=IF((AND(TODAY()>=DATE(2023,6,1),TODAY()0,CPEP!A9),"")
Obviously, this isn't working. Any ideas?
Hi! Your formula is not written down completely. You may find this article helpful: Excel IF between two dates.
If this is not what you need, explain the problem in more detail.
=IF((AND(TODAY()>=DATE(2023,6,1),TODAY()0,CPEP!A9),"")
I don't think it is showing the full formula.
Thanks for the information it helped me a lot, I Tried to combine cells as a cross criteria search.
=COUNTIFS(D$1:D$94,D101,J$1:J$94,"X")
The " X " Mark means was punched on a different Day (Monday,Tuesday, etc) for Example if Cell J1 has mark and Value D101 is in the range criteria, it will count, but only if both met the criteria ( values and X mark).
Hi,
Is it possible to tag a progress with each cell containing different data?
The information will be tagged as "complete" if either "email", "mobile no.", or "address" is provided. It does not necessarily need to have all the information (at least one of the 3 should be fine)
Thank you!
Steve
Hello! To find a partial match of text in a cell, use these instructions: How to find substring in Excel
If a single match is sufficient, use the logical OR function. For example:
=IF(OR(ISNUMBER(SEARCH("address", A2)), ISNUMBER(SEARCH("email", A2))),"complete","")
Hi Alex... Im suffering here...
I need to count how many F there are in multiple colums
If I count the "F" in one column, works great:
=COUNTIFS(A:A,"JUNE",B:B,"F")
but what i really need is to count the "F" in multiple columns:
=COUNTIFS(A:A;"JUNE",B:K,"F")
and it doesnt work, what am I doing wrong? is there a way I can do this?
any help, will be appreciated.
thank you! claudia
Hello! All the ranges you use in the COUNTIFS function must be the same size. That's why your formula doesn't work. I recommend reading this article: Excel COUNTIF and COUNTIFS with OR logic.
Here's an example of the formula:
=COUNTIFS(A:A,"JUNE",B:B,"F") + COUNTIFS(A:A,"JUNE",C:C,"F") + COUNTIFS(A:A,"JUNE",D:D,"F")
oh... got it..that is what i was afraid of... i didnt want to make the formula too long...
thank you so much, let me check that part of the article again!
thank you, Alex!!
I have list of trainings in rows and completion status in columns against the resource. How can I use COUNTIF formula to see number of resources who have completed / in progress for each training? Kindly help
If the formulas and examples in the article above don't work for you, give an example of the source data and the desired result.
is something like this possible?
IF(COUNTIFS(R2,"value1*",S2,"status1"),"aaa","bbb"),IF(COUNTIF(R6,"value2*"),"aaa","bbb")
or
IF(COUNTIFS(R2,"value1*" OR "value2",S2,"status1" OR "status2" or "status3"),"aaa","bbb")
Thanks
Your formulas cannot work. Please study the examples in the article above, and also these manuals: COUNTIF function in Excel - count if not blank, greater than, duplicate or unique and Excel COUNTIF and COUNTIFS with OR logic.
Why do I get an error message with th3 following excel formula?
=IF( COUNT(B90:C90)=2,MOD(C90-B90,1)*24,0)
The error message only shows up after the date is added in Column A. Start time is column B and end time is column C.
Thank you!
Hi! I can't check your formula because I don't have your data. An error is possible if the cells contain text but not time. Also, I can't guess which error message you see. Note that there is no reference to column A in the formula.
Hello Dear Team,
I have an question that is possible to count three or four things with a single formula against every value as shown in the data:-
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 P H A L s/l
P P P P P H P P P P P P H P L L P P P H P a a P P P H S/L S/L P P 21 4 2 2 2
Hi! Unfortunately, this information is not enough to understand what you need.
i want to count total no. of P,H,A,L and s/l with a single formula from the given data.
Hi! If I understand the question correctly, the formula might look something like this:
=SUM(COUNTIF(A1:T1,{"P","H"}))
Thanks a lot Sir,
Actually I want to count all P in column "P"
Count of all H in column H at the end and all L,S/l in their respective column simultaneously with a single formula
e,g: total P=24
Total H=5
Total L-3
Total S/l=2
Hi! If I understand your task correctly, use a separate COUNTIF function for each column. For example,
=COUNTIF(H1:H100,"H")+COUNTIF(P1:P100,"P")
Thank you so much, I coundn't remember how to use more then one formula on the same cell and somehow this was the only post that used the + to help me count more then one different word into the same cell.
Hi alexander,
I have two column of products and I need to find out if a certain brand of a retailer is offered at the other retailer in the other column. Offered by 'retailer ' 'yes' = 1, if not offered then = 0
is it possible to find out if a brand is offered in the other column without using a specific wildcard? otherwise the wildcard will have to be changed per product and this would not be possible.
Hi! We have several instructions on how to identify duplicates in two columns: VLOOKUP to compare two columns in Excel for common values and How to compare two columns in Excel for matches and differences. I hope this will help, otherwise don't hesitate to ask.
Hi, I got small problem.
I cannot find a way to formulate a suitable formula. I hope you can help me.
I have to count how many of the people who worked on the DON project were between the 16 and 24 years, male, from China. I need to include all of this as of 12/31/2015. Most important is fact that some of people quit work before that date so I need to exclude them.
Start of contract is between C3 to C100, end of contract D3 to D100, Birth date E3 to E100, country of residence is F3 to F100, project name is G3 to G100, gender I3 to I100.
I made it as per the formula below, but I don't know how to count the age bracket correctly (between 16 and 24 years) and eliminate people who finished work before this date (12/31/2015).
=COUNTIFS(C3:C100, "<=12/31/2015", F3:F100, "China", G3:G100, "DON", I3:I100, "M", )
TIA John
Hello!
The COUNTIFS function cannot use other functions or formulas as arguments. Therefore, I recommend using the SUMPRODUCT function.
=SUMPRODUCT(--(C3:C100<=DATE(2015,12,31)), --(F3:F100="China"), --(G3:G100="DON"),--(I3:I100="M"), --(DATEDIF(E3:E100,TODAY(),"y")>=16), --(DATEDIF(E3:E100,TODAY(),"y")<=24))
You can also find useful information in this article: How to calculate age in Excel.
Hi Alexander,
Im a new user, how do I express eg that the Yes must relate to the occurrences of LS rather than any Yes that appears in the column.
=COUNTIF('Action Log'!G23:G83,"LS")-COUNTIFS('Action Log'!I23:I83,"Yes")
TIA Karen
Hi! If both of your conditions must be met simultaneously, use the COUNTIFS function to calculate the quantity of values. Read this article above.
Try this formula:
=COUNTIFS('Action Log'!G23:G83,"LS",'Action Log'!I23:I83,"Yes")
I am trying to incorporate wildcards into a COUNTIFS with three criteria because the data is coming from a sharepoint and sometimes includes date and time and sometimes only date and I need to look only at dates. So far this is what I have.
=COUNTIFS('WT Outflow Import'!B:B,$B$4,'WT Outflow Import'!A:A,C18,'WT Outflow Import'!C:C,$B$6)
B6 is the cell containing the date.
The above formula returns what I need if there is no time present with the date in the cell. Otherwise it returns nothing as expected. I need the value matches regardless of whether there is date/time or just date. This is a sharepoint connection, so I don't have the luxury of just changing the data.
I tried using a wildcard and it also returns nothing.
=COUNTIFS('WT Outflow Import'!B:B,$B$4,'WT Outflow Import'!A:A,C18,'WT Outflow Import'!C:C,$B$6&"*")
Any idea where I am going wrong here?
Hi! To use only the date and ignore the time, round up the date and time to a integer number. For example, using the INT function: as INT($B$6)
Is it because the column where I am parsing using the wildcard is a date (number)?
Hi there, I am trying to program a workbook to pull data from different sheets and am hitting a roadblock in trying to program my COUNTIFS formula with multiple criteria.
I am pulling survey data and am looking at the number of compliments per city. In this instance, I have it programmed to pull the comment number that are compliments and from the city, but where I am running into trouble is that the city field comes back to me and can reflect the city of North Fort Myers as "NORTH FORT M" and "N FORT MYERS".
I am trying to figure out how I can program it so both of these are picked up for the same total number. I currently have my formula as =COUNTIFS(Test!O:O,List!W2,Test!D:D,List!C2). But for the data in column D, I want it to be pulled if it reflects the info from cells C2 and D2.
Hoping this is clear and you can help! Thanks.
Hi! Unfortunately, the COUNTIFS function cannot calculate approximate matches. To use the formulas, correct the typos. You can use the Find Fuzzy Duplicates tool to do this. It is available as a part of our Ultimate Suite for Excel that you can install in a trial mode and check how it works for free.
Hi Alexander,
I'm trying to use Countifs with Text.
I have a column with Girls attending classes. In that column I write yes or No.
I then would like to calculate or create a formula in a separate column, that if that specific cell says "Yes" it would allow the formula to occur if it says "No" it would just appear as £0.
Hoping you can help me.
Thanks
Hello! I don't really understand what result you want to get. If you want to count the quantity "Yes", use the COUNTIF function: COUNTIF(B2:B10,"Yes")
If you want to calculate a formula by condition, use the IF function.
Is this also possible to occur with a Dropdown with either yes or no? And How would I allow the formula to occur or have it cancel it out if it say no.
Thanks
Hi Alexander,
What would be the formula for the following example:
Column A has three entries "house", "bungalow" or "flat". Column B has the 'area' of the building. I want to calculate the total area when Column A has either "house" or "bungalow" entered.
I hope this makes sense!
Thanks :)
Hi! The following tutorial should help: Excel SUMIFS and SUMIF with multiple criteria – formula examples.
For example,
=SUMIFS(B1:B10,A1:A10,"house") + SUMIFS(B1:B10,A1:A10,"bungalow")
Hi, I am trying to total how many times a participant has attended a class over a 6 week period. I have Column A containing the names of participants, column B containing the date attended. These participants names listed in column A are repeated in alot of cases as they might attend multiple times over this period. I am wanting to lookup column A, find the exact same names/search criteria and return a total "number" for the sum of how many times their name appears over this period. This would then tell me that "Joe Blow" attended this class 20 times over a 6 week period. Thank you. Ruth :-)
Hi! I hope you have studied the recommendations in the tutorial above. It contains answers to your question. Here is an example formula for your case:
=COUNTIFS(A1:A100,"Joe Blow", B1:B100,"<"&TODAY(), B1:B100,">"&(TODAY()-42))
Hi,
I have 2 columns. Column A shows the time and Column B indicates if a button is pushed with 1='button pushed' and 0='button not pushed'. i need to measure the time between every button push (or the number of cells between each '1' because each cell is equal to 1 minute) but the data spans over 2 weeks (=20 000++ cells). is there a way to make a list of the duration for every "downtime" (time between every button push) without doing them one by one?
for example, collumn B would look something like this:
0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,....
so the first downtime is 22 minutes, second downtime is 6 minutes, third downtime is 18 minutes and so on.
thanks in advance!
Hi! If I understand your task correctly, the following formula should work for you:
=SEARCH("#",SUBSTITUTE(CONCAT($B$1:$B$3000),"1","#",ROW(A2))) - SEARCH("#",SUBSTITUTE(CONCAT($B$1:$B$3000),"1","#",ROW(A1)))-1
Copy this formula down along the column. I hope this will help.
Thank you so much! it works wonderfully!
I changed the '3000' in '$B$3000' to the number of the final cell.
why do we need to use ROW(A1)? I substituted it with 1,2,3,.... and it work just fine, but your method also work. what is the difference?
If you copy the formula down along the column, the value of ROW(A1) will automatically change and return 1,2,3...
Ok everything is clear now! thanks again!
I need help in my file as per below sample.
I have multiple items, some are with same "PCA P/N" and some are not same and it has different date reject each PCA P/N recorded.
Then, what I need is to count the specific PCA P/N which still "OPEN" status and with less than 30days from now.
Another column and formula is for less than 60 days, and next is less than 90days from now.
For example the Date Reject is at column A:A, PCA P/N is at column B:B and the status is at column C:C.
Date Reject PCA P/N STATUS
5-Aug-22 AEM5300-66402 open
Hope you guys understand my statement.
Hi! If I understand your task correctly, try the following formula:
=SUM(((TODAY()-A1:A20)<30)*(B1:B20="AEM5300-66402")*(C1:C20="open"))
or
=SUMPRODUCT(--((TODAY()-A1:A20)<30),--(B1:B20="AEM5300-66402"),--(C1:C20="open"))
For more information, please visit: Excel SUMPRODUCT function with multiple criteria - formula examples.
Thanks for your response. But after I've tried, this is the results.
for this one -> =SUM(((TODAY()-A1:A20)<30)*(B1:B20="AEM5300-66402")*(C1:C20="open")) results shows "0".
and for the 2nd formula shows #VALUE!.
I'll check on your link provided for more other info.
Thanks again.
I wrote this formula based on the description you provided in your original comment. I can't see your data and can't know what dates you are comparing. Also check the dates in column A. If it's text and not dates, the formula doesn't work. Please note that if you’d provided me with the 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.
Hi Sir,
Appreciated your response and thank you.
Actually the output should be like this.
Model <30 days <60 days <90 days 120 days
M5300-66401 8 3 1 0 3
Everyday it will count those within 30 days from today, those within 60days from today and so on.
Those status still "open", and yes the column A is formatted as date.
By right your formula will work but i don't get it also why having error.
Hi! Your answer does not contain any new data that would help give you advice. Check column A. I think it contains text that is formatted as a date. Pay attention to the following article: How to convert text to date in Excel.
I'm checking the error and evaluate the formula shows the date is "45072-A1:A20".What do i need to change or format?
Hi, Please help with the below formula.
The top performer's indication with a yes or no is in column "L". Country is in column X. Now I would like to understand the % of top performers in the United Kingdom and Ireland countries. Used the below formulae but couldn't get the correct %. Please help.
=COUNTIFS('Successors List'!L:L,"Yes",'Successors List'!X:X,"United Kingdom","Ireland")/COUNTIF('Successors List'!L:L,"Yes")
Hi! Pay attention to the following paragraph of the article above: How to count cells with multiple criteria (OR logic).
It covers your case completely.
COUNTIFS('Successors List'!L:L,"Yes",'Successors List'!X:X,"United Kingdom") + COUNTIFS('Successors List'!L:L,"Yes",'Successors List'!X:X,"Ireland")
Hi, Many many thanks for responding. I've used the formula already. However, it shows 3000% which is weird. Do you know why is it not giving the right %?
I can't check your formula because I don't have your data.
* To clarify, the "Successors list" is the top performers list in the Excel file.
Hi!
Would love some formula help here, if possible.
Sheet 1: Customer email (column A), Survey completion date (column B)
Sheet 2: Customer email (column A), Order date (column B), Unique order # (column C)
On Sheet 1 in column C, would like a formula to count quantity of unique orders on Sheet 2 by customer email BEFORE OR ON the survey completion date
Is this something you could help me with?
Hello!
If I understand your task correctly, the following formula should work for you:
=SUM((COUNTIFS('1'!A1:A10,'2'!A1:A10,'1'!B1:B10,">="&'2'!B1:B10)))
Hi Alexander,
I follow your topics and website. You are genius of solving the problems. And you help me many times here.
My question is:
I have one cell A1. Every week in this cell is entering one of this letters ("A", "B", "C","D") from another sheet. . I want to count this letter and multiply by different number.
For Example: countif(A1,"A")*13.75 ........... countif(A1,"D")*2.75 ............ countif(A1,"C")*5.5 ............... countif(A1,"B")*8.25
I want to put this in one formula.
Thank you
Hi! You can get a number depending on the value of the cell using the IFS function.
IFS(A1="A",13.75,A1="B",2.75,A1="C",5.5,A1="D",8.25)
But I'm not understood what result you want to get and why you should use COUNTIF in the one cell.
I thought that I have to use countifs, because i have multiple criterias. Also think about IF with OR. But couldn't put together.
Thank you for quick response.
Result is based on £. For example: if in that cell A1 is D, then I want to be multiplied by 2.75£. People are receiving bonuses for their hard work.
I make setup with your formula IFS and this solve my problem.
Thank you very much.
how can i count total number of unstanding payment for one registration number ( different pay rate) from different worksheet( one worksheet for one month) for the whole year.