# find rows after counting data

#### jts2004

##### Board Regular
In a range A1:A100 the number 3 shows up 10 times. I have a formula to count all the 3's in the range now I want to know what rows they are on.

### Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
In cell B!: =if(a1=3,row(a1),"")
Copy down to cell b100

In cell C1: =if(iserror(small(\$B\$1:\$B\$100,row(1:1)),"",small(\$B\$1:\$B\$100,row(1:1))
Copy down to cell c100.

OR:

In cell B1: =MATCH(3,A1:A100,FALSE)
and in cell B2: =IF(ISERROR(MATCH(3,INDIRECT("A"&B1+1&":a100"),FALSE)),"",MATCH(3,INDIRECT("A"&B1+1&":a100"),FALSE)+B1)

copy B2 to B100.

This only works if your data actually starts at A1... if it starts on a lower row, you need a more general case.

jts2004 said:
In a range A1:A100 the number 3 shows up 10 times. I have a formula to count all the 3's in the range now I want to know what rows they are on.
Book1
ABCD
143
252
365
477
53
68
73
87
99
Sheet1

C1 is used to specify the entry of interest.

C2:

=COUNTIF(A1:A9,C1)

Determines C1's frequency of occurrence in the target range.

C3:

=IF(ROW()-ROW(C\$3)+1<=\$C\$2,SMALL(IF(\$A\$1:\$A\$9=\$C\$1,ROW(\$A\$1:\$A\$9)),ROW()-ROW(C\$3)+1),"")

which is confirmed with control+shift+enter then copied down, determines the native row location per occurrence.

Hi jts2004:

Book1
ABCD
1a33
2b6
338
41
52
63
77
83
9g
10
Sheet1

array formula in cell B1:B3 is ...

=SMALL(IF(A1:A10=3,ROW(A1:A10)),ROW(INDIRECT("1:"&C1)))

Good stuff

Those all work great. Thanks

Re: Good stuff

jts2004 said:
Those all work great. Thanks

They are all different. And that matters...

Replies
6
Views
139
Replies
7
Views
402
Replies
4
Views
114
Replies
5
Views
81
Replies
2
Views
77

1,214,891
Messages
6,122,101
Members
449,066
Latest member
Andyg666

### 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.

### Which adblocker are you using?

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

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