ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Count if two columns match different criteria (https://www.excelbanter.com/excel-worksheet-functions/86291-count-if-two-columns-match-different-criteria.html)

Curt D.

Count if two columns match different criteria
 
How can I count two columns with different criterias. In one column if it
contains 737 and if another column contains LAX, how can I count them if they
only meet this criteria? Thanks for the help.

ExcelBanter AI

Answer: Count if two columns match different criteria
 
Sure, I can help you with that!

To count the number of times both criteria are met, you can use the COUNTIFS function in Excel. Here's how:
  1. Select the cell where you want to display the result.
  2. Type the following formula: =COUNTIFS(range1, criteria1, range2, criteria2)
  3. Replace "range1" with the range of cells that contains the values you want to check for "737". Replace "criteria1" with "737" (without quotes).
  4. Replace "range2" with the range of cells that contains the values you want to check for "LAX". Replace "criteria2" with "LAX" (without quotes).
  5. Press Enter to see the result.

For example, if your data is in columns A and B, and you want to count the number of times "737" appears in column A and "LAX" appears in column B, the formula would be:

=COUNTIFS(A:A, "737", B:B, "LAX")

This will give you the count of all the rows where both criteria are met.

Ardus Petus

Count if two columns match different criteria
 
=SUMPRODUCT((A1:A999=737)*(B1:B999="LAX"))

HTH
--
AP

"Curt D." a écrit dans le message de news:
...
How can I count two columns with different criterias. In one column if it
contains 737 and if another column contains LAX, how can I count them if
they
only meet this criteria? Thanks for the help.




Curt D.

Count if two columns match different criteria
 
That did the trick. thanks. Is there a way to count the non-blank cells
instead of LAX?

"Ardus Petus" wrote:

=SUMPRODUCT((A1:A999=737)*(B1:B999="LAX"))

HTH
--
AP

"Curt D." a écrit dans le message de news:
...
How can I count two columns with different criterias. In one column if it
contains 737 and if another column contains LAX, how can I count them if
they
only meet this criteria? Thanks for the help.





Ardus Petus

Count if two columns match different criteria
 
=SUMPRODUCT((A1:A999=737)*(B1:B999<""))

Cheers,
--
AP

"Curt D." a écrit dans le message de news:
...
That did the trick. thanks. Is there a way to count the non-blank cells
instead of LAX?

"Ardus Petus" wrote:

=SUMPRODUCT((A1:A999=737)*(B1:B999="LAX"))

HTH
--
AP

"Curt D." a écrit dans le message de
news:
...
How can I count two columns with different criterias. In one column if
it
contains 737 and if another column contains LAX, how can I count them
if
they
only meet this criteria? Thanks for the help.







Curt D.

Count if two columns match different criteria
 
Thanks Ardus that helps a lot.

"Ardus Petus" wrote:

=SUMPRODUCT((A1:A999=737)*(B1:B999<""))

Cheers,
--
AP

"Curt D." a écrit dans le message de news:
...
That did the trick. thanks. Is there a way to count the non-blank cells
instead of LAX?

"Ardus Petus" wrote:

=SUMPRODUCT((A1:A999=737)*(B1:B999="LAX"))

HTH
--
AP

"Curt D." a écrit dans le message de
news:
...
How can I count two columns with different criterias. In one column if
it
contains 737 and if another column contains LAX, how can I count them
if
they
only meet this criteria? Thanks for the help.








All times are GMT +1. The time now is 03:44 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com