dynamic named range / expand until 1st #N/A?

bluefish44

Board Regular
Joined
Apr 3, 2009
Messages
190
Hi all - hoping for a little help with this.

Currently I use the following formula to create a dynamic named range that will expand down until the end of my data:

=OFFSET($A$1,0,0,COUNTA($A:$A),1)

But I want to adjust this formula to expand down to the first #N/A instead of all the way to the end. Is this possible?

Thanks in advance
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
try this. to test hit control+G and copy this function in the reference box and see whether the relevant data is highlighted


OFFSET($A$1,0,0,COUNTA(A:A)-COUNT(A:A,ISERROR(A:A)),1)
 
Upvote 0
Hi all - hoping for a little help with this.

Currently I use the following formula to create a dynamic named range that will expand down until the end of my data:

=OFFSET($A$1,0,0,COUNTA($A:$A),1)

But I want to adjust this formula to expand down to the first #N/A instead of all the way to the end. Is this possible?

Thanks in advance
Is there any non-error data after the first #N/A?

Is column A supposed to house text or numeric values?
 
Upvote 0
You could use this non-volatile version

=INDEX(Sheet1!$A:$A,1,1):INDEX(Sheet1!$A:$A, MIN(IF(ISNA(Sheet1!$A$1:$A$1000), ROW(Sheet1!$A$1:$A$1000))), 1)

If you do not want the last cell in the named range to contain #N/A, subtract 1

=INDEX(Sheet1!$A:$A,1,1):INDEX(Sheet1!$A:$A, MIN(IF(ISNA(Sheet1!$A$1:$A$1000), ROW(Sheet1!$A$1:$A$1000))) - 1, 1)
 
Upvote 0

Forum statistics

Threads
1,215,377
Messages
6,124,597
Members
449,174
Latest member
chandan4057

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