I want to count 0 in an array with 5Rows and 5Columns Rowwise

CA_Punit

Well-known Member
Joined
Nov 18, 2019
Messages
944
Office Version
  1. 365
Platform
  1. Windows
I have an array which gives the following result

Book1
ABACADAEAFAGAH
4
501111
600111
700011
800000
900000
1001111
11
12
13
14
Sheet2
Cell Formulas
RangeFormula
AC5:AG10AC5=--(Z1:Z6>AB1:AF1)
Dynamic array formulas.


I want to return count of Zero row Wise Like this in an arrray

Book1
AJ
51
62
73
85
95
101
Sheet2


How to do it ( The range specified above is using Dynamic array formula ) and I want the result to display count in only one range as stated in 2nd sheet
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Got the Answer Using Mmult function it can be done.

Is there any other option using combination of rows and column function.
 
Upvote 0
What about this...

=COUNTIF(AC5:AG5,0)

And, if you do not copy this down where the range is blank, this...

=5-SUM(AC5:AG5)
 
Upvote 0
What result do you want from that data.
I suspect that the MMULT result might not be as robust as you are hoping.
Is your actual data as structured as the example (only 0 and 1 all the 0 on the left)
 
Upvote 0
Book1
ABCDEFGHIJKL
1I Want to Sort the Data in Ascending Order
2
3Z
4A
5B
6Q
7W
8A
9
10So I Did this
11
12011111
13000000
14010001
15011001
16011101
17000000
18
19So I Needed to count the Numbers of Zero Row-Wise. So Used MMULT Function
20
211
226
234
243
252
266
27
28But I am not getting the Data Sorted in Ascending Order. I Don’t want to use Dynamic Array Formula like Sorted.
29
30A
31A
32Q
33B
34A
35Z
36
37
38
39
Sheet4
Cell Formulas
RangeFormula
A12:F17A12=--(A3:A8>TRANSPOSE(A3:A8))
A21:A26A21=6-MMULT(A12#,(ROW(A12:A17)-ROW(A12)+1)^0)
A30:A35A30=INDEX(A3:A8,LARGE(A21#,(ROW(A12:A17)-ROW(A12)+1)))
Dynamic array formulas.
 
Upvote 0
You can get the same result by putting =COUNTIF(A12:F12,0) in A21 and drag it down.

But your overall goal of sorting with a formula..

put this formula in A30
=INDEX(A:A, MOD(SMALL(COUNTIF($A$3:$A$8,"<"&$A$3:$A$8)+ROW($A$3:$A$8)/100,ROW(A1)), 1)*100,1)
enter it with Ctrl-Shift-Enter

and then drag it downwards.
If you want it sorted descenting change the < to >
 
Upvote 0
"+ROW($A$3:$A$8)/100"

Great Trick sir, Made my day.
Will definetly apply in future.
 
Upvote 0

Forum statistics

Threads
1,214,392
Messages
6,119,254
Members
448,879
Latest member
oksanana

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