Count Rows in a Dynamic Range

joseulloa22

New Member
Joined
Dec 28, 2013
Messages
25
Hello- good morning
Looking for help. The below table can start in any row (i.e, cell A17= "Components" could be in A150). Columns will remain as it shows . In column I (starting in I22 in this case), I would like to have the content of B22. On this case, I used the following formula but since my # of rows will change I think that rather than using A21 I would need a dynamic reference but not sure how to do that

=OFFSET(INDEX(A:A,MATCH("Components",A:A,0)),ROWS(INDEX(A:A,MATCH("Components",A:A,0)):A21),1)
Capture.PNG
 
Last edited:
How do you place your formula? If it is always placed in Column I and at the same row as the first Identification, for the example above it would be simply =B22 and copy down, but that seems too trivial.

If the copy of the id might be on some other row in Column I then if the first cell you have the formula in is in Row 2 you could use (change the Row()+2 element so the 2 reflects the row the formula is in):

Rich (BB code):
=OFFSET($A$1, MATCH("Components",A:A,0)+ROW()+2,1)

An alternative formula is shown below, and this works wherever you move the data too:

Book1
ABCDEFGHI
1
2|__A
3|__B
4|__C
5|__D
6|__E
7|__F
8
9
10Components
11Short
12
13IdentificationWhsRequiredTotal req'dAvailShortErrors
14********************
15|__A16/22/2020135135no|__A
16|__B|__B
17|__C|__C
18|__D|__D
19|__E|__E
20|__F|__F
Sheet1
Cell Formulas
RangeFormula
I2:I7I2=OFFSET($A$1, MATCH("Components",A:A,0)+ROW()+2,1)
I15:I20I15=OFFSET($A$1, MATCH("Components",A:A,0)+ROW()-(1+MATCH("Components",A:A,0)),1)


HTH
 
Upvote 0

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Peter, the second formula =OFFSET($A$1, MATCH("Components",A:A,0)+ROW()-(1+MATCH("Components",A:A,0)),1), worked real nice in any row I throw my data between col A and H. It is pulling the content from col B and placing into respective cells in col I. That's phenomenal, thanks so much!
Thanks C Moore and C_Punit as well
 
Upvote 0
Delighted to have helped and many thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,899
Messages
6,122,155
Members
449,068
Latest member
shiz11713

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