COUNTIFS formula

johns99

Board Regular
Joined
Jun 11, 2013
Messages
212
Office Version
  1. 365
Platform
  1. Windows
Hello,

I'm having issues with a COUNTIFS formula...I'm using the below

=COUNTIFS($CT$6:$CT$7666,"P1",$X$6:$X$7666,{"x","+"})

this returns a result of 166, however when I filter on the above criteria "P1" and {"x","+"} I'm showing 217

Any ideas why this would not be working?

Thanks in advance,

John
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"

barry houdini

MrExcel MVP
Joined
Mar 23, 2005
Messages
20,825
You are only seeing the count for "x", you need an added SUM function to get the total for "x" and "+"

=SUM(COUNTIFS($CT$6:$CT$7666,"P1",$X$6:$X$7666,{"x","+"}))
 
Upvote 0

bbott

Well-known Member
Joined
Feb 5, 2010
Messages
2,350
It's only counting x's (the first value in the array). You would need to add a third argument so that x and + are separate.
 
Upvote 0

johns99

Board Regular
Joined
Jun 11, 2013
Messages
212
Office Version
  1. 365
Platform
  1. Windows
Thank you both for your quick responses!

@barry houdini I've added the SUM and this fixed the problem. Thank you both, have a great weekend!
 
Upvote 0

johns99

Board Regular
Joined
Jun 11, 2013
Messages
212
Office Version
  1. 365
Platform
  1. Windows
I do have an additional question that I hope one of you will be able to help me with...

Using the info above...so taking a count of "P1" and {"x","+"}...I am also trying to count information in column W. The issue is there are duplicates in column W that I would not want to include so I can find out how many unique values are in this column.

So I would like to take a count of how many unique values are in column W for people who are labeled with {"x","+"} in column X and "P1" in column CT.

Is this possible?

Let me know if I'm not clear.
 
Upvote 0

barry houdini

MrExcel MVP
Joined
Mar 23, 2005
Messages
20,825
That's a bit trickier but you can use an "array formula" like this

=SUM(IF(FREQUENCY(IF($CT$6:$CT$7666="P1",IF(($X$6:$X$7666="x")+($X$6:$X$7666="+"),IF($W$6:$W$7666<>"",MATCH($W$6:$W$7666,$W$6:$W$7666,0)))),ROW($W$6:$W$7666)-ROW($W$6)+1),1))

confirmed with CTRL+SHIFT+ENTER
 
Upvote 0

johns99

Board Regular
Joined
Jun 11, 2013
Messages
212
Office Version
  1. 365
Platform
  1. Windows
This worked! Thank you for all your help today, it's much appreciated.

Have a great weekend.

Cheers,

John
 
Upvote 0

Forum statistics

Threads
1,191,579
Messages
5,987,425
Members
440,096
Latest member
yanaungmyint

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
Top