Named Range Error

How_Do_I

Well-known Member
Joined
Oct 23, 2009
Messages
1,831
Office Version
  1. 2010
Platform
  1. Windows
Hello,can anyone tell me where I’m going wrong with this please…<o:p></o:p>
E33 isreturning the expected value when I use a named range called “Season13” whichis defined as =Sheet1!$CD$5:$CK$556<o:p></o:p>
<o:p></o:p>
However when I redefine "Season13" to =Sheet1!$CD$5:INDEX(Sheet1!$CK$5:$CK$556,Sheet1!$CD$2)where $CD$2 =552 I’m getting a #REF error… when I check this name in Insert/Namesthe “dancing ants are in the correct place which is really confusing me.<o:p></o:p>
<o:p></o:p>
What am I doing wrong please?<o:p></o:p>
<o:p></o:p>

<o:p> </o:p>

E<o:p></o:p>

33<o:p></o:p>

1 - 1<o:p></o:p>

<tbody>
</tbody>
<o:p></o:p>
Spreadsheet Formulas<o:p></o:p>

Cell<o:p></o:p>
Formula<o:p></o:p>
E33<o:p></o:p>
=IF(ISNA($B33),"",INDEX(INDIRECT("Season"&A33),$B33,4)&" - "&INDEX(INDIRECT("Season"&A33),$B33,5))<o:p></o:p>

<tbody>
</tbody>
<o:p></o:p>

<tbody>
</tbody>
<o:p></o:p>
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

Danerida

Board Regular
Joined
Aug 25, 2014
Messages
152
Try:
Code:
[FONT=Calibri][COLOR=#000000]=Sheet1!$CD$5[/COLOR][/FONT]&":"&[FONT=Calibri][COLOR=#000000]INDEX(Sheet1!$CK$5:$CK$556,Sheet1!$CD$2)[/COLOR][/FONT]
 
Upvote 0

Teeroy

Well-known Member
Joined
Nov 9, 2012
Messages
2,244
Office Version
  1. 365
Platform
  1. Windows
The formula does not return a range directly. Since you are including a variable you'll probably need the indirect function.

Try defining the Name as =INDIRECT("Sheet1!$CD$5:$CK$"&Sheet1!$CD$2+4)
 
Upvote 0

How_Do_I

Well-known Member
Joined
Oct 23, 2009
Messages
1,831
Office Version
  1. 2010
Platform
  1. Windows
No luck with those suggestions, has anyone else got any ideas please? Thanks for the help so far though...
 
Upvote 0

ukmikeb

Well-known Member
Joined
Jul 10, 2009
Messages
2,757
Hi

If you just select the area CD5 to CK556 when defining "Season13", as a named range, then you have the flexibility to make adjustments to extract the data.

The reason you are getting the #Ref error is because the result of "INDEX(Sheet1!$CK$5:$CK$556,Sheet1!$CD$2)" is a value and not an address.

hth
 
Upvote 0

Danerida

Board Regular
Joined
Aug 25, 2014
Messages
152
If your data in column CD is contiguous (no blanks), for your named range you could use:
=OFFSET(Sheet1!$CD$5,,,COUNTA($CD:$CD))
 
Upvote 0

How_Do_I

Well-known Member
Joined
Oct 23, 2009
Messages
1,831
Office Version
  1. 2010
Platform
  1. Windows
Hi Danerida...Your solution didn't work for me... <o:p></o:p>
<o:p> </o:p>
Defining"Season13" as=Sheet1!$CD$5:OFFSET(Sheet1!$CD$5,,7,COUNTA(Sheet1!$CK:$CK)) or =Sheet1!$CD$5:INDEX(Sheet1!$CK$5:$CK$556,Sheet1!$CD$2)where $CD$2 =552 highlights the correct range when checking in the name manager but both return a #REF error to my formula... <o:p></o:p>
<o:p> </o:p>
ukmikeb must beright, these formulas are returning a value not a cell address. Defining Season13 as =Sheet1!$CD$5:$CK$556 isthe only formula that is working.<o:p></o:p>
 
Upvote 0

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
40,380
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
  2. MacOS
Indirect doesn't work with dynamic ranges, only literal addresses.
 
Upvote 0

Forum statistics

Threads
1,191,171
Messages
5,985,067
Members
439,938
Latest member
MAlhash

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
Top