Embedded countif statements?

klynshoe

Board Regular
Joined
Jun 17, 2010
Messages
176
Hello,

I have the following formula which provides a % value of any cell within the range specified that is a 1 or 2.

=(COUNTIF(Metrics!$P$3:$P$12,1)+COUNTIF(Metrics!$P$3:$P$12,2))/COUNT(Metrics!$P$3:$P$12)

I would like to narrow this down even further by only counting the values in the range where the cell in $B2 (Column B) equals a particular value. At first I tried an IF/THEN stmt but that only gave me the one count in that row, instead of counting everything with that value in Column B. Now I'm stuck! I may have to an array of sorts buy my experience with arrays is limited so I would need add'l assistance in setting that up if that's the best way to go about it.

Any advice would be greatly helpful!

EXCEL 2010
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

dropanddrive03

New Member
Joined
Jan 16, 2014
Messages
5
I'm not sure if I correctly understand your question. Have you tried just changing the 1 and 2 to cell references? Assuming you have, can you either embed the sheet or send a dropbox link or something like that? It's much easier to help when I can see exactly what you're doing...
 

klynshoe

Board Regular
Joined
Jun 17, 2010
Messages
176
Nevermind, I figured out I can accomplish this using COUNTIFS instead. I wasn't familiar with that function and figured it out. woo hoo!
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,167,817
Messages
5,855,801
Members
431,765
Latest member
RedleoUK

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