Can I use "Count If" function with noncontiguous s

bullocks6

New Member
Joined
Sep 4, 2003
Messages
5
Can the "Count If" function be used with a noncontiguous range(set) of cells?

For example,

I want H1 to display the number of "X" that are found in A1, C1, and E1.

I can get the the Count If function to work fine with the range A1:E1.

However for this project I can't allow the "X" in B1 and D1 to be counted.

Thanks for any suggestions.

Allen Bullock
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Re: Can I use "Count If" function with noncontiguo

It looks like you want to count "X" in every 2nd cell in a horizontal range. If so:

=SUMPRODUCT((MOD(COLUMN($A$1:$E$1)-CELL("Col",$A$1)+0,2)=0)*($A$1:$E$1="X"))

Given the fact you have a small set of cells, you could also use:

=(A1="X")+(C1="X")+(E1="X")
 
Upvote 0
Re: Can I use "Count If" function with noncontiguo

bullocks6 said:
Can the "Count If" function be used with a noncontiguous range(set) of cells?

For example,

I want H1 to display the number of "X" that are found in A1, C1, and E1.

I can get the the Count If function to work fine with the range A1:E1.

However for this project I can't allow the "X" in B1 and D1 to be counted.

Thanks for any suggestions.

Allen Bullock

Just in case,

http://www.mrexcel.com/board2/viewtopic.php?t=29977&postdays=0&postorder=asc&start=10
 
Upvote 0
Re: Can I use "Count If" function with noncontiguo

Aladin,

Thank you so much. I think I will go with your second suggestion
(=(A1="X")+(C1="X")+(E1="X") since it seems a little "simpler" and I will never be pulling info from more than 5 or 6 cells at a time. I had been beating my head against the wall for 2 days trying to get the Count If function to work for me.

I thank you and the teachers at my school thank you. It will mean one less column for them to fill in. This is for a spreadsheet in which the teachers fill in student performance info.

Brian,

Thank you for the link to the other posts related to my question. I enjoyed seeing the different approaches to a similar question.

Allen
 
Upvote 0

Forum statistics

Threads
1,221,526
Messages
6,160,340
Members
451,637
Latest member
hvp2262

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