# Help with using Offset for Row #REF error

#### Barbz

##### New Member

I have this complex (for me) formula on a large spreadsheet. As part of the process I must create copies of the spreadsheet with only the rows that meet "manager" as criteria.
This means I'm often deleting the first row of data which then results in a #Ref error in formula in below in the area I've made bold.

=IFERROR(IF(J142="","",INDEX(\$A\$2:\$A\$126,AGGREGATE(15,6,(ROW(\$N\$2:\$N\$126)-ROW(\$N\$2)+1)/(\$N\$2:\$N\$126=L142),COUNTIF(\$L\$142:L142,L142))))," ")

I know I can use OFFSET but I'm not sure how or where to apply it in this particular formula. Or if it will work in this formula.

Any assistance is very appreciated.

### Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

#### pgc01

##### MrExcel MVP
Hi
Welcome to the board

... ,(ROW(\$N\$2:\$N\$126)-ROW(\$N\$2)+1)/ ...

try

... ,(ROW(\$N\$2:\$N\$126)-MIN(ROW(\$N\$2:\$N\$126))+1)/ ...

#### Barbz

##### New Member
Thank you so much PGC. The change works perfectly. And now I have something new to learn about; the MIN function. I've been researching for days and never came across this as a possible solution. So I can't tell you how much your quick response means to me. Thanks again!

#### pgc01

##### MrExcel MVP
You're welcome. Thanks for the feedback.

Replies
3
Views
151
Replies
4
Views
233
Replies
3
Views
174
Replies
6
Views
118
Replies
1
Views
102

1,129,463
Messages
5,636,427
Members
416,918
Latest member
twc2c

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