+ Reply to Thread
Results 1 to 5 of 5

How to pass a Named Range from a cell as an argument to a formula

  1. #1
    Registered User
    Join Date
    04-16-2009
    Location
    Kilkenny, Ireland.
    MS-Off Ver
    Excel 365
    Posts
    47

    How to pass a Named Range from a cell as an argument to a formula

    Hi,

    I have the following formula which works fine in this form:
    Please Login or Register  to view this content.
    where GradingMatrix1 is a Named range.

    I have other named ranges GradingMatrix2, GradingMatrix3 that I would like to pass to the formula depending on user input.

    If a cell, say A2, contains a value "GradingMatrix1" and I convert the formula as follows:
    Please Login or Register  to view this content.
    then (unsurprisingly) the formula considers the array argument to be the single cell A2, and not the named range referred to in the cell contents.

    Maybe somebody out there could suggest a method of passing the range named within the cell as an argument to the formula?

    Many thanks
    B.
    Last edited by Orson100; 10-21-2009 at 09:42 AM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: How to pass a Named Range from a cell as an argument to a formula

    Try

    =vlookup(H2,Indirect("GradingMatrix"&A2),2)
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Valued Forum Contributor jj72uk's Avatar
    Join Date
    03-22-2008
    Location
    Essex, England
    MS-Off Ver
    Work - Office 2000, Home - Office 2007E
    Posts
    360

    Re: How to pass a Named Range from a cell as an argument to a formula

    NBVC beat me to it... and his method is obviously better than mine..

    I was going along the lines of:

    =IF(A2=GradingMatrix1,VLOOKUP(H2,GradingMatrix1,2)),IF(A2=GradingMatrix2,VLOOKUP(H2,GradingMatrix2,2)),IF(A2=GradingMatrix3,VLOOKUP(H2,GradingMatrix3,2),"")

  4. #4
    Registered User
    Join Date
    04-16-2009
    Location
    Kilkenny, Ireland.
    MS-Off Ver
    Excel 365
    Posts
    47

    Re: How to pass a Named Range from a cell as an argument to a formula

    Great thanks NBVC, perfect solution and thanks for tip on parsing the named range ref!!

    Orson.
    Last edited by NBVC; 10-20-2009 at 10:00 AM. Reason: corrected spelling of my name

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: How to pass a Named Range from a cell as an argument to a formula

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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