+ Reply to Thread
Results 1 to 8 of 8

Using Named range in a Vlookup

  1. #1
    Registered User
    Join Date
    10-31-2010
    Location
    SA
    MS-Off Ver
    Excel 2007
    Posts
    8

    Using Named range in a Vlookup

    I have a good understanding on how to use Vlookup except that when doing a fill down, it increments the lookup range.

    I looked at defining the range I would use in the formula

    =IF(B7<>"",VLOOKUP(B7,Sheet2!A5:D24,C2,FALSE),"") to

    =IF(B7<>"",VLOOKUP(B7,MyList,C2,FALSE),"")

    C2 is reference to 2, 3 or 4 which reads four columns based on whats in B7 and returns either column 2,3,4 pricing variables.

    I defined the mylist as suggested in the function bar area but methinks that there is a trick in the syntax and as usual MS Help is as clear as mud. I tried single and double quotes an parenthesis, even the formula assist yields no clues.

    The idea of the named range is so that I do not have to go through a manual edit of the range of cells after the fill down.

    Any help will be appreciated for this dumb old man
    Last edited by bernie.kruger; 11-03-2010 at 09:20 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Using Named range in a Vlookup

    Try

    =IF(B7<>"",VLOOKUP(B7,Sheet2!$A$5:$D$24,$C$2,FALSE),"")

    You define a name in the name box
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    10-31-2010
    Location
    SA
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Using Named range in a Vlookup

    Doh

    Just figured it out

    =IF(B7<>"",VLOOKUP(B7,Sheet1!A$5:D$24,C2,FALSE),"")

    That makes the look-up range static.

    Still knowing how to use a named range would probably be a lot more user friendly.

  4. #4
    Registered User
    Join Date
    10-31-2010
    Location
    SA
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Using Named range in a Vlookup

    Quote Originally Posted by royUK View Post
    Try

    =IF(B7<>"",VLOOKUP(B7,Sheet2!$A$5:$D$24,$C$2,FALSE),"")

    You define a name in the name box
    Thanks Roy,
    I figured out the $ bits as you were posting, is there a way to use a named range like I was trying to?

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Using Named range in a Vlookup

    Your range will only have rows fixed not both rows & columns

    see

    Dynamic named ranges
    Named ranges
    Last edited by royUK; 11-03-2010 at 09:08 AM. Reason: correct typo

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,467

    Re: Using Named range in a Vlookup

    You normally make the table references absolute, rather than just the rows:

    Please Login or Register  to view this content.

    The following formula does the same thing where "NamedRange" is G$2:$H$6

    Please Login or Register  to view this content.

    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  7. #7
    Registered User
    Join Date
    10-31-2010
    Location
    SA
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Using Named range in a Vlookup

    Thanks all, what I was forgetting to do is tell it what sheet to find the named range

    All sorted, I hate it when this happens....

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,467

    Re: Using Named range in a Vlookup

    Excel usually knows where to find named ranges :-)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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