Combining two criteria's for a countif Formula

searchingforhelp

Board Regular
Joined
Nov 11, 2020
Messages
67
Office Version
  1. 365
Platform
  1. Windows
Hi,

I am trying to count the number of instances when column A is greater or equal to 16 and has the word juice in a deferent column. The second part of the formula is not connecting with the first. Can anyone suggest how I can connect the two?

=Countifs(A2:A10,">=16")+Countifs(J2:J10,"Juice"))

Thank you for your help
Ernie
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
With COUNTIFS, you put both criteria in the same formula.
If you do two formulas, you will get two separate counts that will be added together.\

Try:
Excel Formula:
=Countifs(A2:A10,">=16",J2:J10,"Juice")

See here for more explanation and details: MS Excel: How to use the COUNTIFS Function (WS)
 
Upvote 0
Solution
try this

=COUNTIFS(A2:A10,">=16")+COUNTIFS(J2:J10,"Juice")
 
Upvote 0
try this

=COUNTIFS(A2:A10,">=16")+COUNTIFS(J2:J10,"Juice")
That won't work. That will count each condition separately, and add up the results. It is sort of like an incomplete "OR" (because you would also need to back out the the ones where both conditions exist on the same row to avoid double-counting), when they asked for an "AND".

Note the requirement:
I am trying to count the number of instances when column A is greater or equal to 16 and has the word juice in a deferent column.
 
Upvote 0
@Joe4 I think that is what is the requirement of @searchingforhelp is
if count >=16 and Juice and result is to sum both the counts.

let's wait for @searchingforhelp reply.

or he can use the =Countifs(A2:A10,">=16",J2:J10,"Juice") -- this will consider both and give a single count.

Thanks.
 
Upvote 0
@Joe4 I think that is what is the requirement of @searchingforhelp is
if count >=16 and Juice and result is to sum both the counts.
It looks like they marked a solution to this problem already, but if they wanted a count of all rows where either of those conditions are true, then they would need to amend your formula like this:
Rich (BB code):
=COUNTIFS(A2:A10,">=16")+COUNTIFS(J2:J10,"Juice")-Countifs(A2:A10,">=16",J2:J10,"Juice")

Otherwise, you will double-count rows where both conditions are true (and you could even conceivably end up with a count that is greater than your number of rows)!
 
Upvote 0
Hi team, thank you for this. So to answer the question, I needed help to find what is greater then 16 in one column and if Juice is associated with it in a second column, count it.

Example 4-27-2021.xlsx
ABCD
1NumberNameThere are three in total that fit the criteria
21Banana
32Juice
426Juice
517Apple
650Juice
730Banana
826Juice
Sheet1


Hope this helps
 
Upvote 0

Forum statistics

Threads
1,214,832
Messages
6,121,850
Members
449,051
Latest member
excelquestion515

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top