The tutorial explains how to use COUNTIFS and COUNTIF formulas with multiple criteria in Excel based on AND as well as OR logic. You will find a number of examples for different data types - numbers, dates, text, wildcard characters, non-blank cells and more.
Of all Excel functions, COUNTIFS and COUNTIF are probably most often mixed up because they look very much alike and both are purposed for counting cells based on the specified criteria.
The difference is that COUNTIF is designed for counting cells with a single condition in one range, whereas COUNTIFS can evaluate different criteria in the same or in different ranges. The aim of this tutorial is to demonstrate different approaches and help you choose the most efficient formula for each particular task.
Excel COUNTIFS function - syntax and usage
The Excel COUNTIFS function counts cells across multiple ranges based on one or several conditions. The function is available in Excel 365, 2021, 2019, 2016, 2013, Excel 2010, and Excel 2007, so you can use the below examples in any Excel version.
COUNTIFS syntax
The syntax of the COUNTIFS function is as follows:
- criteria_range1 (required) - defines the first range to which the first condition (criteria1) shall be applied.
- criteria1 (required) - sets the condition in the form of a number, cell reference, text string, expression or another Excel function. The criteria defines which cells shall be counted and can be expressed as 10, "<=32", A6, "sweets".
- [criteria_range2, criteria2]… (optional) - these are additional ranges and their associated criteria. You can specify up to 127 range/criteria pairs in your formulas.
In fact, you don't have to remember the syntax of the COUNTIF function by heart. Microsoft Excel will display the function's arguments as soon as you start typing; the argument you are entering at the moment is highlighted in bold.
Excel COUNTIFS - things to remember!
- You can use the COUNTIFS function in Excel to count cells in a single range with a single condition as well as in multiple ranges with multiple conditions. If the latter, only those cells that meet all of the specified conditions are counted.
- Each additional range must have the same number of rows and columns as the first range (criteria_range1 argument).
- Both contiguous and non-contiguous ranges are allowed.
- If the criteria is a reference to an empty cell, the COUNTIFS function treats it as a zero value (0).
- You can use the wildcard characters in criteria - asterisk (*) and question mark (?). See this example for full details.
How to use COUNTIFS and COUNTIF with multiple criteria in Excel
Below you will find a number of formula examples that demonstrate how to use the COUNTIFS and COUNTIF functions in Excel to evaluate multiple conditions.
How to count cells with multiple criteria (AND logic)
This scenario is the easiest one, since the COUNTIFS function in Excel is designed to count only those cells for which all of the specified conditions are TRUE. We call it the AND logic, because Excel's AND function works this way.
Formula 1. COUNTIFS formula with multiple criteria
Suppose you have a product list like shown in the screenshot below. You want to get a count of items that are in stock (value in column B is greater than 0) but have not been sold yet (value is column C is equal to 0).
The task can be accomplished by using this formula:
=COUNTIFS(B2:B7,">0", C2:C7,"=0")
And the count is 2 ("Cherries" and "Lemons"):
Formula 2. COUNTIFS formula with two criteria
When you want to count items with identical criteria, you still need to supply each criteria_range / criteria pair individually.
For example, here's the right formula to count items that have 0 both in column B and column C:
=COUNTIFS($B$2:$B$7,"=0", $C$2:$C$7,"=0")
This COUNTIFS formula returns 1 because only "Grapes" have "0" value in both columns.
Using a simpler formula with a single criteria_range like COUNTIFS(B2:C7,"=0") would yield a different result - the total count of cells in the range B2:C7 containing a zero (which is 4 in this example).
How to count cells with multiple criteria (OR logic)
As you have seen in the above examples, counting cells that meet all of the specified criteria is easy because the COUNTIFS function is designed to work this way.
But what if you want to count cells for which at least one of the specified conditions is TRUE, i.e. based on the OR logic? Overall, there are two ways to do this - by adding up several COUNTIF formulas or using a SUM COUNTIFS formula with an array constant.
Formula 1. Add up two or more COUNTIF or COUNITFS formulas
In the table below, supposing you want to count orders with the "Cancelled" and "Pending" status. To have it doen, you can simply write 2 regular Countif formulas and add up the results:
=COUNTIF($C$2:$C$11,"Cancelled") + COUNTIF($C$2:$C$11,"Pending")
In case each of the functions is supposed to evaluate more than one condition, use COUNTIFS instead of COUNTIF. For example, to get the count of "Cancelled" and "Pending" orders for "Apples" use this formula:
=COUNTIFS($A$2:$A$11, "Apples", $C$2:$C$11,"Cancelled") + COUNTIFS($A$2:$A$11, "Apples", $C$2:$C$11,"Pending")
Formula 2. SUM COUNTIFS with an array constant
In situations when you have to evaluate a lot of criteria, the above approach is not the best way to go because your formula would grow too big in size. To perform the same calculations in a more compact formula, list all of your criteria in an array constant, and supply that array to the criteria argument of the COUNTIFS function. To get the total count, embed COUNTIFS inside the SUM function, like this:
In our sample table, to count orders with the status "Cancelled" or "Pending" or "In transit", the formula would go as follows:
=SUM(COUNTIFS($C$2:$C$11, {"cancelled", "pending", "in transit"}))
In a similar manner, you can count cells based on two or more criteria_range / criteria pairs. For instance, to get the number of "Apples" orders that are "Cancelled" or "Pending" or "In transit", use this formula:
=SUM(COUNTIFS($A$2:$A$11,"apples",$C$2:$C$11,{"cancelled","pending","in transit"}))
You can find a few more ways to count cells with OR logic in this tutorial: Excel COUNTIF and COUNTIFS with OR conditions.
How to count numbers between 2 specified numbers
By and large, COUNTIFS formulas for numbers fall into 2 categories - based on several conditions (explained in the above examples) and between the two values you specify. The latter can be accomplished in two ways - by using the COUNTIFS function or by subtracting one COUNTIF from another.
Formula 1. COUNTIFS to count cells between two numbers
To find out how many numbers between 5 and 10 (not including 5 and 10) are contained in cells C2 through C10, use this formula:
=COUNTIFS(C2:C10,">5", C2:C10,"<10")
To include 5 and 10 in the count, use the "greater than or equal to" and "less than or equal to" operators:
=COUNTIFS(B2:B10,">=5", B2:B10,"<=10")
Formula 2. COUNTIF formulas to count numbers between X and Y
The same result can be achieved by subtracting one Countif formula from another. The first one counts how many numbers are greater than the lower bound value (5 in this example). The second formula returns the count of numbers that are greater than the upper bound value (10 in this case). The difference between the first and second number is the result you are looking for.
- =COUNTIF(C2:C10,">5")-COUNTIF(C2:C10,">=10") - counts how many numbers greater than 5 and less than 10 are in the range C2:C10. This formula will return the same count as shown in the screenshot above.
- =COUNTIF(C2:C10, ">=5")-COUNTIF(C2:C10, ">10") - the formula counts how many numbers between 5 and 10 are in the range C2:C10, including 5 and 10.
How to use cell references in COUNTIFS formulas
When using logical operators such as ">", "<", "<=" or ">=" together with cell references in your Excel COUNTIFS formulas, remember to enclose the operator in "double quotes" and
add an ampersand (&) before a cell reference to construct a text string.
In a sample dataset below, let's count "Apples" orders with amount greater than $200. With criteria_range1 in cells A2:A11 and criteria_range2 in B2:B11, you can use this formula:
=COUNTIFS($A$2:$A$11, "Apples", $B$2:$B$11, ">200")
Or, you can input your criteria values in certain cells, say F1 and F2, and reference those cells in your formula:
=COUNTIFS($A$2:$A$11, $F$1, $B$2:$B$11, ">"&$F$2)
Please notice the use of absolute cell references both in the criteria and criteria_range arguments, which prevents the formula from being broken when copied to other cells.
For more information about the use of an ampersand in COUNTIF and COUNTIFS formulas, please see Excel COUNTIF - frequently asked questions.
How to use COUNTIFS with wildcard characters
In Excel COUNTIFS formulas, you can use the following wildcard characters:
- Question mark (?) - matches any single character, use it to count cells starting and/or ending with certain characters.
- Asterisk (*) - matches any sequence of characters, you use it to count cells containing a specified word or a character(s) as part of the cell's contents.
Tip. If you want to count cells with an actual question mark or asterisk, type a tilde (~) before an asterisk or question mark.
Now let's see how you can use a wildcard char in real-life COUNTIFS formulas in Excel. Suppose, you have a list of projects in column A. You wish to know how many projects are already assigned to someone, i.e. have any name in column B. And because we are learning how to use the COUNTIFS function with multiple criteria, let's add a second condition - the End Date in column D should also be set.
Here is the formula that works a treat:
=COUNTIFS(B2:B10,"*",D2:D10,"<>"&""))
Please note, you cannot use a wildcard character in the 2nd criteria because you have dates rather that text values in column D. That is why, you use the criteria that finds non-blank cells: "<>"&""
COUNTIFS and COUNTIF with multiple criteria for dates
The COUNTIFS and COUNTIF formulas you use for dates are very much similar to the above formulas for numbers.
Example 1. Count dates in a specific date range
To count the dates that fall in a certain date range, you can also use either a COUNTIFS formula with two criteria or a combination of two COUNTIF functions.
For example, the following formulas count the number of dates in cells C2 through C10 that fall between 1-Jun-2014 and 7-Jun-2014, inclusive:
=COUNTIFS(C2:C9, ">=6/1/2014", C2:C9, "<=6/7/2014")
=COUNTIF(C2:C9, ">=6/1/2014") - COUNTIF(C2:C9, ">6/7/2014")
Example 2. Count dates with multiple conditions
In the same manner, you can use a COUNTIFS formula to count the number of dates in different columns that meet 2 or more conditions. For instance, the below formula will find out how many products were purchased after the 20th of May and delivered after the 1st of June:
=COUNTIFS(C2:C9, ">5/1/2014", D2:D9, ">6/7/2014")
Example 3. Count dates with multiple conditions based on the current date
You can use Excel's TODAY() function in combination with COUNTIF to count dates based on the current date.
For example, the following COUNTIF formula with two ranges and two criteria will tell you how many products have already been purchased but not delivered yet.
=COUNTIFS(C2:C9, "<"&TODAY(), D2:D9, ">"&TODAY())
This formula allows for many possible variations. For instance, you can tweak it to count how many products were purchased more than a week ago and are not delivered yet:
=COUNTIFS(C2:C9, "<="&TODAY()-7, D2:D9, ">"&TODAY())
This is how you count cells with multiple criteria in Excel. I hope you will find these examples helpful. Anyway, I thank you for reading and hope to see you on our blog next week!
2039 comments
I'm working on a spreadsheet where the COUNTIF formula was pulling from a local desktop so the formula is now giving me a "REF" error since that employee is no longer here. I can see where I can change the path of the formula but unsure what Table2[#Data],"Administration" is coming from. As I don't see any tables to reference on that report when generated.
=COUNTIF('C:\Users\employee\Downloads\NewHireReport (20).xlsx'!Table2[#Data], "Administration")
If you don't know what Table2[#Data],"Administration" is coming from, how should I know?
I need your help on how the countif/s formula can help me with the sample data below:
OMNIS ID Eval Type Week Day RPID Score Opportunity Opportunity Opportunity
CCADA Regular Eval Week 1 Monday 10545125 90.00% 4.2 COMPLETE STATUS NOTES
CCADA Regular Eval Week 1 Monday 10546620 100.00%
CCADA Regular Eval Week 1 Monday 10544879 100.00%
CLSAN Regular Eval Week 1 Monday 10548087 90.00% 4.2 COMPLETE STATUS NOTES
CLSAN Regular Eval Week 1 Monday 10548155 90.00% 4.2 COMPLETE STATUS NOTES
CLSAN Regular Eval Week 1 Monday 10548052 100.00%
I have this sample data and I wanted to count the column of opportunities (3 dedicated columns) per OMINS ID per week. I tried the countifs formula but I am unsuccessful. I hope you can help me. :)
Your explanation makes it hard for me to understand what you want to calculate. I'll try to guess that you need to calculate the quantity by two criteria.
=COUNTIFS(A2:A10,"CCADA",C2:C10,"Week 1",E2:E10,"<>"&"",F2:F10,"<>"&"",G2:G10,"<>"&"")
If that's not what you want, please tell me exactly what result you want.
I tried to recreate the formula but was still unsuccessful :( I made a simple data below.
Sample Data:
NAME Week Opportunity
Ken Week 1 1.1 Use of Available Resources
Ken Week 1 3.1 File Delivery
Ken Week 1 1.1 Use of Available Resources
Ken Week 2 4.2 Complete Notes
Ken Week 2 4.2 Complete Notes
Ken Week 2 4.1 Action Taken
I would like to see how much Ken did incur the opportunity "1.1 Use of Available Resources" on week 1. Same outcome/principle if I want to see the number of opportunities "4.2 Complete Notes" were incurred on week 2.
I hope this helps and I really thank you for helping me :)
Hi!
I recommended you a formula in which you can specify all the necessary conditions. For example:
=COUNTIFS(A2:A10,"CCADA",C2:C10,"Week 2",E2:E10,"="&"4.2 Complete Notes",F2:F10,"<>"&"",G2:G10,"<>"&"")
I was able to recreate the formula. Thank you so much for the help :)
Hi,
I have a formula =COUNT(IF(MONTH($M:$M)=4,1)) which returns how many dates in a column are in each month (April in the example). However I want to combine this with a search in another column "=Yes". But when I am using COUNTIFS I am getting an error. So in essence I want to calculate how many lines are 'Month' and 'Yes' (where the month is currently dd/mm/yyyy). Any advice greatly received
Hello!
The COUNTIFS function cannot have only a cell value as an argument, but not a formula. Therefore, use the SUMPRODUCT function to calculate values with calculations.
If I understand your task correctly, try the following formula:
=SUMPRODUCT(--(MONTH(M1:M10)=4),--(N1:N10="yes"))
Thank you, however I am coming up with #value!. I believe this maybe because not all the values in column M are dates. The column is linked to arrival dates and if the goods have arrived the cell states 'here'. Can I adapt the formula above to state sumproduct IF cell is date (month = 4) and column N =yes?
Hi!
To ignore errors, replace them with 0 using IFERROR function.
=SUMPRODUCT(--IFERROR(MONTH(M1:M10)=4,0),--(N1:N10="yes"))
Thank you, worked perfectly :-)
Hi,
There is my problem, it's a parking case, I have to know how in a one hour range how many cars arrive in the parking,how many leave and how many are on the parking.
I have my Data table there is an exemple :
Park_Time_IN Park_Time_OUT
01/02/2022 18:54 01/02/2022 19:55
02/02/2022 06:34 02/02/2022 08:21
02/02/2022 07:06 02/02/2022 08:15
And I have my Calendar table, for this period it will be :
Date_Time_A Date_Time_B Departure_Number Arrival_Number Number_Car_in_parking
01/02/2022 18:00 01/02/2022 18:59 ???? ???? ????
01/02/2022 19:00 01/02/2022 19:59
01/02/2022 20:00 01/02/2022 20:59
01/02/2022 21:00 01/02/2022 21:59
01/02/2022 22:00 01/02/2022 22:59
01/02/2022 23:00 01/02/2022 23:59
02/02/2022 00:00 02/02/2022 00:59
02/02/2022 01:00 02/02/2022 01:59
02/02/2022 02:00 02/02/2022 02:59
02/02/2022 03:00 02/02/2022 03:59
02/02/2022 04:00 02/02/2022 04:59
02/02/2022 05:00 02/02/2022 05:59
02/02/2022 06:00 02/02/2022 06:59
02/02/2022 07:00 02/02/2022 07:59
02/02/2022 08:00 02/02/2022 08:59
All my cells have the format : Custom : dd/mm/yyyy hh:mm:ss
I tried many formulas with countif but I didn't have a good result. Do you know which formula should I put?
And also should I seperate in new columns Date and Time cause I don't know if I can easily comparate cells with date&time in it.
Thanks a lot for your help
Hi!
If I understand your task correctly, the following formula should work for you:
arrive -
=COUNTIFS(A1:A10,">="&T1,A1:A10,"<="&T2)
on the parking -
=COUNTIFS(A1:A10,"<="&T1,B1:B10,">="&T2)
T1 and T2 - time
I hope it’ll be helpful.
I need to be able to check if the cell is blank. If it's not, then check the cell for specific text. If that cell is blank, I need to check a separate cell for the same text. Any suggestions on how to do that?
Example in words, if cell A is not blank, check cell A for "apples", if A is blank, go to cell C and check for "apples".
I forgot to say, I'm checking a cell range: i.e. A2:A50 or C2:C50
Hi!
Try to use the recommendations described in this article: Excel Nested IF statements - examples, best practices and alternatives. If I understand your task correctly, try the following formula:
=IF(NOT(ISBLANK(A3)),A3="apples",IF(NOT(ISBLANK(C3)),C3="apples",""))
Hello Sir,
I have some data that is grouped but I just want to use Countif formula on specific columns out of all the columns in grouped data, however i can't ungroup the data and use the formula. Is there any way i can use countif formula to do the same?
Hi, looking to use countifs to help with a roster I'm working on. Column C = days of the week, I want the formula to count all cells containing the initials 'RT' in columns F-J if the corresponding row in column C = Friday. Have read the article above, and am trying this: =COUNTIFS($C$4:$C$49,"Friday", $F$4:J$49,"RT") but getting a #VALUE error. Would really appreciate any help, I'm not very good on Excel
Hello!
The COUNTIFS function can only use ranges of the same size. Your data ranges have different dimensions. So use the SUM function to calculate cells where both conditions are met.
Try this formula:
=SUM(($C$4:$C$49="Friday")*($F$4:J$49= "RT"))
That worked, thankyou soooo much :-)
Hello,
I need help developing a formula.
I have one column with names such as Sarah, William etc between G2:G100. And a seperate column with multiple options such as completed, pending, not completed between I2:I100.
I want to count specifically for an employee (Sarah G2:G100) who has the following answers in I2:I100 "completed" or "pending" or "blank cell" but not count the other answers.
Tried many different formulas. Can you help?
Hi!
Try the formulas described in the article above.
For example,
=COUNTIFS(G2:G100,"Sarah",I2:I100,"completed") + COUNTIFS(G2:G100,"Sarah",I2:I100,"pending")
Hi ,i am looking for a formula helps me to count how many cells in row contains values in a special range,lets say i have a column with the values 6.24 ; 6.8; 7.24; 7.35; 7.24. How can i count the values that are from 6.0 to 6.9 and how many are from 7.0 to 7.45?
Hi!
Please re-check the article above since it covers your case.
=COUNTIFS(A1:A10,">6",A1:A10,"<6.9")
I need to know how many cells in two columns meet certain criteria together. So, for BA3:BA141, ">120" and BB3:BB141, ">80", how do I get the total cells where both those critera are met? So far when I've tried, I get the count of all cells meeting one or the other added up and I need the count of the cells where both are met
Hi!
If I understand your question correctly, use the COUNTIFS function as recommended in the article above.
=COUNTIFS(BA3:BA141, ">120", BB3:BB141, ">80")
Dear Sir
I have two columns , one column have open or closed and other column have S or L. I need formula to count open only with L
OPEN S
CLOSED S
OPEN L
OPEN L
CLOSED L
OPEN S
OPEN L
CLOSED L
OPEN L
Hi!
Use the COUNTIFS function as described in the article above. For an example, see Formula 2.
HI can you help me, the formula when someone chooses one option in the data validation, for example THEORETICAL COURSE, OR PRACTICAL COURSE and automaticallly counts +1 as a student , in the number of students
Hi! Have you tried the ways described in this blog post? If they don’t work for you, then please describe your task in detail, I’ll try to suggest a solution.
I'm creating a list that has 3 sets of criteria, My formula below works fine when "Reference!$E$21" is just one value, but the column has 3 values, and I want to exclude 1.
For example, Reference!$E$21 equals A, and the other two values are T and L. I want to keep the values equal to A and L and exclude T . what is the best way to exclude that value in the formula below?
=IFERROR(IF(Reference!$C$1="H",INDEX('[Data!$A$3:$BR$50000,SMALL(IF(COUNTIFS(Reference!$B$16,'[Data!$U$3:$U$50000,Reference!$B$18,'[Data!$U$3:$U$50000,Reference!$E$21,'[Data!$AM$3:$AM$50000),ROW('[Data!$B$3:$B$50000)-MIN(ROW('[Data!$A$3:$BR$50000))+1),ROW(B1)),COLUMN(B1)),INDEX('[Data!$A$3:$BR$50000,SMALL(IF(COUNTIFS(Reference!$B$16,'[Data!$U$3:$U$50000,Reference!$B$19,'[Data!$U$3:$U$50000,Reference!$E$21,'[Data!$AM$3:$AM$50000),ROW('[Data!$B$3:$B$50000)-MIN(ROW('[Data!$A$3:$BR$50000))+1),ROW(B1)),COLUMN(B1))),"")
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 There,
I'm looking to find a formula that takes Column A (Date) from sheet 2022-2023 + anything in Column H that contains a word (could have other words in it as well) from sheet 2022-2023 and counts it in a cell on another sheet. so basically Column A equals a certain date and if it meets that criteria, count the number of cells in column H that contains that certain word (plus could have other words in the cell)
The closest I have to this is =SUMPRODUCT(--('2022-2023'!A:A=DATE(2023, 1,31)),--('2022-2023'!H:H="Leaders")) but its only counting the exact text where some other cells have "Leaders, Supervisors" and it won't include it.
I've tried this too but getting an Error =COUNTIFS('2022-2023'!A:A,DATE(2023, 1,31),('2022-2023'!H:H,"Leaders"))
Thanks for the help!
Hello!
You can determine a partial match of a word and a text string with the combination ISNUMBER + SEARCH functions.
=ISNUMBER(SEARCH("Leaders",H1:H10))
I hope this will help, otherwise don't hesitate to ask.
Hi there,
It didn't quite work as I'm not looking for a true/false response but more so how many cells contain that word. so for example if there are ten cells in the A column that have the same date, how many of those ten cells in the H column contain the word leaders
Hi!
This works great if you apply it to your SUMPRODUCT formula.
For example,
=SUMPRODUCT(--('2022-2023'!A:A=DATE(2023, 1,31)),--(ISNUMBER(SEARCH("Leaders",'2022-2023'!H:H))))
I can't check the formula that contains unique references to your workbook worksheets.
Hello, the following formula counts the number of times names from a range of cells get listed.
=SUMPRODUCT(8*ISNUMBER(SEARCH(B51,$C$18:$P$41)))
Is there a way to ad a seperate individual cell to the formula to be counted along with the existing range? The individual cell is N4
Hi!
If I understand your task correctly, try the following formula:
=SUMPRODUCT(8*ISNUMBER(SEARCH(B51,$C$18:$P$41)))+(1*ISNUMBER(SEARCH(B51,N4)))
You are awesome....I just had to change N4 to $N$4 and it worked great.
=SUMPRODUCT(8*ISNUMBER(SEARCH(B51,$C$18:$P$41)))+(1*ISNUMBER(SEARCH(B51,$N$4)))
Thank You so much!
I'm sorry. For example, I have a Test A and Test B for Standard 1, as well as Standards 2 and 3. I want the Google Sheet to average the highest score from each standard. For some students, this could be the score on Test A and for others it could be the score on Test B. Is there a way to have the function select the highest of two cells and average it with other cells?
I am looking for a formula that can count the highest of two columns only if the value is above 59. I have been trying different versions of COUNTIFS, but it always ends up counting all of the values that are above 59 instead of only counting the higher one if it is above 59. Is there a way to do this? I am trying to count the highest of two test grades only if it is above a 59.
This is the last thing I tried.
=COUNTIFS(B2>C2,[B2>59])+COUNTIFS(B259])
Thank you for offering your knowledge.
Hi!
As it's currently written, it's hard to tell exactly what you're asking. What result do you want to get? Give an example of the source data and the expected result.
Hi... I have a data where in one column there is a request I'd and on the other column there is a description of activity, e.g. updation of Address, Name, Swift, Postal etc. I want to count the occurance of unique activity with reference to request I'd. Though if there are 4 similar request I'd and activity description against it is updation of Address for 4 times in a row but I have to count them as 1 if all 4 has criteria address into it. So even if the count is 4. I want a formula to count it as 1 only. That means the order entry person worked on the same request 4 times will be considered as 1 request, but if there are other activity against the same req id, it should also show 1 count for it as well. but if the occurance of another activity is more than one it should restrict the count as 1 only.
Kindly help with your expertise
Hello!
The answer to your question can be found in this article: Count unique values with criteria. I hope it’ll be helpful. If something is still unclear, please feel free to ask.
Hi!
What if I need to know if a certain number is between 10% above or below another?
Example:
Seller A price: 100 | Seller B price: 110 = Seller A's price inside of 10% of seller B's price
Is this possible with countif?
Hello!
The COUNTIF function cannot use formulas inside itself. So try the function SUMPRODUCT :
=SUMPRODUCT(--(B1:B5/A1:A5<=1.1))
Hi i have a report that has 8 sheets(by Names) which has a table of contents that i need to count based individual text. However with the countif formula, it came out as date (I.E. 1/0/1900)
Formula as follows
=COUNTIFS(Joel!F4:F25,"NICF019")+COUNTIF(Ivan!F4:F25,"NICF019")+COUNTIF(Amanda!F4:F25,"NICF019")+COUNTIF('Wai Loon'!F4:F25,"NICF019")+COUNTIF('Zu Yang'!F4:F25,"NICF019")+COUNTIF(Elly!F2:F25,"NICF019")+COUNTIF(Hazel!F4:F25,"NICF019")+COUNTIF(Kenneth!F4:F25,"NICF019")
Is the formula incorrect?
Hi! To see a number instead of a date, change the cell format to General. I can't check a formula that contains unique references to the data in your worksheets.
This works well. My formula is okay. Have change the cell to general. :D
Million Thanks
Hello,
I have a spreadsheet where I log employee names for each day of the week, which I select from a dropdown list in each cell. Naturally there is more than one employee working some days, so I used visual basic which allowed me to list multiple variables inside the same cell. However, the cells with the multiple names are not being counted. My current formula is =COUNTIFS(C18:P41,B51:B71)
Is there a formula that will allow me to also count the data in cells that have more than one name listed?
Hello!
Give me an example of the data of how several names are written in a cell, and what separators are used between them. Then I'll try to give some advice.
The data is just names separated by a forward slash as the delimiter. Ex. John Doe / Tim Hobbs in one cell, and Jeffrey Beckham in another.
Currently John Doe & Tim Hobbs aren't being counted,
Hi!
To find a partial match of two text strings, use the function SEARCH.
For example,
=SUMPRODUCT(--ISNUMBER(SEARCH(H1,$A$1:$D$10))
This did something totally unexpected to the totals inside my table where all the name counts were the same. Almost like it added them all together. I wanted them to be counted individually, even if they are in the same cell.
Hi!
To understand what you want to do, give an example of the source data and the desired result.
For example: I need names from my table to be counted each time one appears on my spreadsheet range as shown.
Cell 1 Cell 2 Cell 3 Cell 4 Cell 5
Tremayne 1 Tremayne Joe Fred Richard Richard / Mathew / Joe
Richard 4
Mathew 2 Cell 6 Cell 7 Cell 8 Cell 9 Cell 10
Joe 3 Tony / Erick Darrel / Joe Darrel Richard / Mathew Richard
Darrel 2
Fred 1
Currently the Cells 5, 6, 7, & 9 are not being recognized because they contain more than one name separated by a forward slash.
Hi!
As I recommended earlier, enter the desired name in cell H1 and the formula will show you how many times that name is written in the range on the text lines.
=SUMPRODUCT(--ISNUMBER(SEARCH(H1,$A$1:$D$10)))
You can get a list of all the names if you split text into separate cells and use the UNIQUE function.