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

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.

Seti

Well-known Member
Joined
May 19, 2002
Messages
2,916
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
 

tomk

New Member
Joined
Sep 2, 2002
Messages
4
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.
 

Dave Patton

Well-known Member
Joined
Feb 15, 2002
Messages
4,972
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
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.
 

Forum statistics

Threads
1,144,510
Messages
5,724,782
Members
422,578
Latest member
annsalinas

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