find rows after counting data

jts2004

Board Regular
Joined
Apr 21, 2004
Messages
156
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

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
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.
 
Upvote 0
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.
 
Upvote 0
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.
 
Upvote 0
Hi jts2004:

How about ...
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)))
 
Upvote 0

Forum statistics

Threads
1,215,064
Messages
6,122,939
Members
449,094
Latest member
teemeren

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