Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default Dynamic Range Setup...

Hi All

I'm trying (without success) to build a dynamic named range as
follows:

I have a row of variable sequential years
2004 | 2005 | 2006 | 2007 | 2008 | 2009 | 2010 | 2011

The user can select a 'start year' from a dropdown list created from
the years above.

I then need to create a dynamic range to only include years after the
start date, but up to a maximum of 5 years.

So, if the user selects the start year 2005, the the end year list
would be
2006 - 2010

However, if the user selects the start year 2009 the end year list
would only include
2010 - 2011 as 2011 is the last year available...

I've checked Debra Dalgleish's site regarding this type of thing but
just can't crack it!

Any help appreciated.

Trevor Williams
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,646
Default Dynamic Range Setup...

Years being in A1:H1, start year in A2, use this formula in
DataValidationSource for end year:
=OFFSET(A1,0,MATCH(A2,A1:H1,0),1,MIN(5,8-MATCH(A2,A1:H1,0)))

Regards,
Stefi

€˛Trevor Williams€¯ ezt Ć*rta:

Hi All

I'm trying (without success) to build a dynamic named range as
follows:

I have a row of variable sequential years
2004 | 2005 | 2006 | 2007 | 2008 | 2009 | 2010 | 2011

The user can select a 'start year' from a dropdown list created from
the years above.

I then need to create a dynamic range to only include years after the
start date, but up to a maximum of 5 years.

So, if the user selects the start year 2005, the the end year list
would be
2006 - 2010

However, if the user selects the start year 2009 the end year list
would only include
2010 - 2011 as 2011 is the last year available...

I've checked Debra Dalgleish's site regarding this type of thing but
just can't crack it!

Any help appreciated.

Trevor Williams

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,420
Default Dynamic Range Setup...

What are you going to do with this range?

Assuming the years are in B1:J1, and the dropdown is in A2, try

=INDEX(INDEX($B$1:$J$1,MATCH($A$2,$B$1:$J$1,0)):$J $1,0)

--
__________________________________
HTH

Bob

"Trevor Williams" wrote in message
...
Hi All

I'm trying (without success) to build a dynamic named range as
follows:

I have a row of variable sequential years
2004 | 2005 | 2006 | 2007 | 2008 | 2009 | 2010 | 2011

The user can select a 'start year' from a dropdown list created from
the years above.

I then need to create a dynamic range to only include years after the
start date, but up to a maximum of 5 years.

So, if the user selects the start year 2005, the the end year list
would be
2006 - 2010

However, if the user selects the start year 2009 the end year list
would only include
2010 - 2011 as 2011 is the last year available...

I've checked Debra Dalgleish's site regarding this type of thing but
just can't crack it!

Any help appreciated.

Trevor Williams



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 181
Default Dynamic Range Setup...

Hi Stefi, this is so close, thanks.
The row of years could go on and on whereas your formula is restricted to
the 11 years I've mentioned.

Is there a way to change it to use a variable year range?

Trevor

"Stefi" wrote:

Years being in A1:H1, start year in A2, use this formula in
DataValidationSource for end year:
=OFFSET(A1,0,MATCH(A2,A1:H1,0),1,MIN(5,8-MATCH(A2,A1:H1,0)))

Regards,
Stefi

€˛Trevor Williams€¯ ezt Ć*rta:

Hi All

I'm trying (without success) to build a dynamic named range as
follows:

I have a row of variable sequential years
2004 | 2005 | 2006 | 2007 | 2008 | 2009 | 2010 | 2011

The user can select a 'start year' from a dropdown list created from
the years above.

I then need to create a dynamic range to only include years after the
start date, but up to a maximum of 5 years.

So, if the user selects the start year 2005, the the end year list
would be
2006 - 2010

However, if the user selects the start year 2009 the end year list
would only include
2010 - 2011 as 2011 is the last year available...

I've checked Debra Dalgleish's site regarding this type of thing but
just can't crack it!

Any help appreciated.

Trevor Williams



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 181
Default Dynamic Range Setup...

Hi Bob - thanks for the response.

The idea of this range is to restrict the user in selecting an end year that
is a max of 5 years from the start year. This would be chosen from an End
Year dropdown list populated with the dynamic range.

Your formula lists ALL the years post the chosen Start Year. Can it be
restricted to list 5 years only, or the number of years post start year if <
5? (i.e. if yrs are 2009 - 2014 and start yr is 2010 the list would show
2011,2012,2013,2014 (not 5 years))

Think that makes sense(?)

Trevor Williams


"Bob Phillips" wrote:

What are you going to do with this range?

Assuming the years are in B1:J1, and the dropdown is in A2, try

=INDEX(INDEX($B$1:$J$1,MATCH($A$2,$B$1:$J$1,0)):$J $1,0)

--
__________________________________
HTH

Bob

"Trevor Williams" wrote in message
...
Hi All

I'm trying (without success) to build a dynamic named range as
follows:

I have a row of variable sequential years
2004 | 2005 | 2006 | 2007 | 2008 | 2009 | 2010 | 2011

The user can select a 'start year' from a dropdown list created from
the years above.

I then need to create a dynamic range to only include years after the
start date, but up to a maximum of 5 years.

So, if the user selects the start year 2005, the the end year list
would be
2006 - 2010

However, if the user selects the start year 2009 the end year list
would only include
2010 - 2011 as 2011 is the last year available...

I've checked Debra Dalgleish's site regarding this type of thing but
just can't crack it!

Any help appreciated.

Trevor Williams




  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 181
Default Dynamic Range Setup...

Also Bob, the year row is not resticted to the years I've supplied, and could
go way beyond $J$1... is there a way to build that variable in?

"Bob Phillips" wrote:

What are you going to do with this range?

Assuming the years are in B1:J1, and the dropdown is in A2, try

=INDEX(INDEX($B$1:$J$1,MATCH($A$2,$B$1:$J$1,0)):$J $1,0)

--
__________________________________
HTH

Bob

"Trevor Williams" wrote in message
...
Hi All

I'm trying (without success) to build a dynamic named range as
follows:

I have a row of variable sequential years
2004 | 2005 | 2006 | 2007 | 2008 | 2009 | 2010 | 2011

The user can select a 'start year' from a dropdown list created from
the years above.

I then need to create a dynamic range to only include years after the
start date, but up to a maximum of 5 years.

So, if the user selects the start year 2005, the the end year list
would be
2006 - 2010

However, if the user selects the start year 2009 the end year list
would only include
2010 - 2011 as 2011 is the last year available...

I've checked Debra Dalgleish's site regarding this type of thing but
just can't crack it!

Any help appreciated.

Trevor Williams




  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 181
Default Dynamic Range Setup...

Think I've sorted it by adding the COUNTA function into it...

=OFFSET(A1,0,MATCH(A2,A1:H1,0),1,MIN(5,COUNTA($1:$ 1)-MATCH(A2,A1:H1,0)))

Thanks again Stefi.

"Trevor Williams" wrote:

Hi Stefi, this is so close, thanks.
The row of years could go on and on whereas your formula is restricted to
the 11 years I've mentioned.

Is there a way to change it to use a variable year range?

Trevor

"Stefi" wrote:

Years being in A1:H1, start year in A2, use this formula in
DataValidationSource for end year:
=OFFSET(A1,0,MATCH(A2,A1:H1,0),1,MIN(5,8-MATCH(A2,A1:H1,0)))

Regards,
Stefi

€˛Trevor Williams€¯ ezt Ć*rta:

Hi All

I'm trying (without success) to build a dynamic named range as
follows:

I have a row of variable sequential years
2004 | 2005 | 2006 | 2007 | 2008 | 2009 | 2010 | 2011

The user can select a 'start year' from a dropdown list created from
the years above.

I then need to create a dynamic range to only include years after the
start date, but up to a maximum of 5 years.

So, if the user selects the start year 2005, the the end year list
would be
2006 - 2010

However, if the user selects the start year 2009 the end year list
would only include
2010 - 2011 as 2011 is the last year available...

I've checked Debra Dalgleish's site regarding this type of thing but
just can't crack it!

Any help appreciated.

Trevor Williams

  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 181
Default Dynamic Range Setup...

D'oh -- try this one...

=OFFSET(A1,0,MATCH(A2,$1:$1,0),1,MIN(5,COUNTA($1:$ 1)-MATCH(A2,$1:$1,0)))

"Trevor Williams" wrote:

Hi Stefi, this is so close, thanks.
The row of years could go on and on whereas your formula is restricted to
the 11 years I've mentioned.

Is there a way to change it to use a variable year range?

Trevor

"Stefi" wrote:

Years being in A1:H1, start year in A2, use this formula in
DataValidationSource for end year:
=OFFSET(A1,0,MATCH(A2,A1:H1,0),1,MIN(5,8-MATCH(A2,A1:H1,0)))

Regards,
Stefi

€˛Trevor Williams€¯ ezt Ć*rta:

Hi All

I'm trying (without success) to build a dynamic named range as
follows:

I have a row of variable sequential years
2004 | 2005 | 2006 | 2007 | 2008 | 2009 | 2010 | 2011

The user can select a 'start year' from a dropdown list created from
the years above.

I then need to create a dynamic range to only include years after the
start date, but up to a maximum of 5 years.

So, if the user selects the start year 2005, the the end year list
would be
2006 - 2010

However, if the user selects the start year 2009 the end year list
would only include
2010 - 2011 as 2011 is the last year available...

I've checked Debra Dalgleish's site regarding this type of thing but
just can't crack it!

Any help appreciated.

Trevor Williams

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Print Range Setup MCheru Setting up and Configuration of Excel 2 March 27th 09 03:10 AM
How to setup daily auto-save-as of a dynamic worksheet Turbine Mechanic Excel Discussion (Misc queries) 1 August 14th 08 04:59 PM
How do I setup dynamic linking between worksheets ie. T-O-C RikVL Excel Worksheet Functions 0 May 12th 06 08:57 PM
Dynamic Range with unused formula messing up x axis on dynamic graph [email protected] Charts and Charting in Excel 2 February 2nd 06 08:02 PM
Print range setup Patty via OfficeKB.com Excel Discussion (Misc queries) 2 October 14th 05 07:06 PM


All times are GMT +1. The time now is 05:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"