countif (nested)

tomk

New Member
Joined
Sep 2, 2002
Messages
4
I want to identify the number of iterations of more than one value (e.g, 47 and 54 in more than one range (four ranges).

Here is my cumbersome function as it now stands:
=COUNTIF($I$3:$K$38, 47)+COUNTIF($T$3:$V$32, 47)+COUNTIF($AC$3:$AE$42, 47)+COUNTIF($AK$3:$AM$42, 47)+COUNTIF($I$3:$K$38, 54)+COUNTIF($T$3:$V$32, 54)+COUNTIF($AC$3:$AE$42, 54)+COUNTIF($AK$3:$AM$42, 54)

Can I nest the arguments to downsize the function? Thanks
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
I know this is not the best solution, but it will reduce the size of your formula.

=SUM(COUNTIF($I$3:$K$38,A1:A2)+COUNTIF($T$3:$V$32,A1:A2)+COUNTIF($AC$3:$AE$42,A1:A2)+COUNTIF($AK$3:$AM$42,A1:A2))

Enter this as an array formula using CTRL-SHIFT-Enter and make sure that A1:A2 has 47 and 54 entered in it. I have used A1:A2 as an example only, use any cells you want.

HTH
 
Upvote 0
Thanks for the reply, Seti.

Problem is that the values 47 or 54 may appear randomly in any cell within any of the four ranges. In essence, I am trying to monitor its appearance.
 
Upvote 0
You could name the ranges (see Dynamic ranges and offset)

=SUMPRODUCT((Ir={47,54})+(Jr={47,54})+(Kr={47,54})) etc.

Column I named Ir etc.
 
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,251
Members
448,556
Latest member
peterhess2002

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