+ Reply to Thread
Results 1 to 4 of 4

Option to use different named ranges in formulae

  1. #1
    Registered User
    Join Date
    10-09-2009
    Location
    Scotland
    MS-Off Ver
    Excel 2010
    Posts
    38

    Option to use different named ranges in formulae

    Hi,

    I have a file with many look ups using named ranges. I would like to be able to look up from different ranges without having to change the formula.

    e.g. in the formula below TableX, Employees and Months are all names of ranges and repeated many times in the file. I would like to be able to, say, allow a user of the file to look up TableY instead but be able to switch back to TableX at any time. Is there an easy way to this without having to have an IF statement used in very cell?

    I thought about having the table name to use entered in 1 cell somewhere and then have the formulae look at this to determine which table e.g. cell A1 could have "TableX" or "TableY" entered. I couldn't get this to work with the formula even using &A1 to try to pick up the name.

    Does anybody have any ideas on how to do this?

    =IF(AND(RIGHT(AW3,1)="0",LEN(AW3)=2),0,INDEX(TableX,MATCH($D3,Employees,0),MATCH(AW3,Months,0)))

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Option to use different named ranges in formulae

    Maybe something like this...

    A1 = TableX or TableY

    Then...

    =IF(AND(RIGHT(AW3)="0",LEN(AW3)=2),0,INDEX(INDIRECT(A1),MATCH($D3,Employees,0),MATCH(AW3,Months,0)))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    10-09-2009
    Location
    Scotland
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: Option to use different named ranges in formulae

    Thanks Tony. This does the trick and should be easy to build in throughout the file.

    Many thanks

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Option to use different named ranges in formulae

    You're welcome. Thanks for the feedback!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Copy values of all named range in wb1 to identically named ranges in wb2
    By JAMIAM in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-24-2016, 06:58 PM
  2. [SOLVED] VBA creates named ranges, but named ranges disappear
    By BrotherNeptune in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-05-2015, 03:22 PM
  3. Define only 2 named ranges from a list of named ranges...
    By abhi900 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-29-2014, 04:20 AM
  4. Looping Mutliple Named Resized Ranges in next empty row below another named range
    By gingumdog in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-19-2014, 08:15 PM
  5. [SOLVED] Determining if the value of a cell can be a named range, then assigning named ranges after
    By Romulo in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-15-2013, 06:05 PM
  6. Applying Named Ranges to Existing Formulae
    By Usman_W in forum Excel General
    Replies: 3
    Last Post: 06-26-2012, 01:59 PM
  7. [SOLVED] Can Named ranges be used in file link formulae?
    By Philip J Smith in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-10-2006, 08:30 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1