+ Reply to Thread
Results 1 to 9 of 9

Thread: Vlookup with named range

  1. #1
    Valued Forum Contributor realniceguy5000's Avatar
    Join Date
    03-20-2008
    Location
    PA
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    926

    Vlookup with named range

    Hi, I have named a range on another worksheet Same workbook "lrow" I have placed this formula in the named range:
    ='UPC SCANS'!$B$2:INDEX('UPC SCANS'!$B2:$D$1000,COUNTA('UPC SCANS'!$B$2:$D$1000),1)
    I placed this formula above in a cell to see what it would return and it returns 0 ? I thought it was suppose to return the lastrow of data in col B

    On another worksheet I have a vlookup formula like this which works.

    =VLOOKUP(A6,'UPC SCANS'!B2:D1000,3,FALSE)
    However when I try to add the named range in place of the B2:D1000 I Get a ref# error?

    Here is what I have for the formula:
    =VLOOKUP(A6,'MASTER(REV1).xls'!lrow,3,FALSE)
    Anyone have any idea's what is wrong. Maybe something is wrong with the named range formula ?

    Anyway Thanks for looking, Mike
    Last edited by realniceguy5000; 08-23-2011 at 02:26 PM.

  2. #2
    Forum Guru Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    MS Excel 2010
    Posts
    2,252

    Re: Vlookup with named range

    How about

    =VLOOKUP(A6,OFFSET('UPC SCANS'!$B$2,0,0,COUNTA('UPC SCANS'!$B:$B),3),3,FALSE)

  3. #3
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,640

    Re: Vlookup with named range

    The COUNTA() part of your named range should be 1 column wide.

    e.g

    ='UPC SCANS'!$B$2:INDEX('UPC SCANS'!$B2:$D$1000,COUNTA('UPC SCANS'!$B$2:$B$1000),1)

    and doesn't this work after the above change? i.e. do you need the workbook reference?

    =VLOOKUP(A6,lrow,3,FALSE)
    Last edited by NBVC; 08-23-2011 at 09:36 AM.
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

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

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

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  4. #4
    Valued Forum Contributor realniceguy5000's Avatar
    Join Date
    03-20-2008
    Location
    PA
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    926

    Re: Vlookup with named range

    Hi, Thank You

    Sorry for the delay...

    But Still getting a ref error. I'm not sure what is wrong.I dont need a workbook ref as you said, I removed that, Not sure what to do now I been messing with all morning.

    I tried to included an example workbook, But keep getting database error from this site.

    Thank You, Mike
    Thank You, Mike

    Some Helpful Hints:

    1. New members please read & follow the Forum Rules
    2. Use Code Tags...Place[code]Before the first line and[/code] After the last line.
    3. If you are pleased with a solution mark your post SOLVED.
    4. Thank those who have help you by clicking the scales at the top right of the post.

    Here...

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

    Re: Vlookup with named range

    Sorry try this one instead as the named range:

    ='UPC SCANS'!$B$2:INDEX('UPC SCANS'!$B2:$D$1000,COUNTA('UPC SCANS'!$B$2:$B$1000),4)

    If still no go, try zipping the file first before uploading.
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

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

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

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  6. #6
    Valued Forum Contributor realniceguy5000's Avatar
    Join Date
    03-20-2008
    Location
    PA
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    926

    Re: Vlookup with named range

    Ok, Here is the workbook I'm working with, let me know if you have any questions.

    Thanks again for your help.

    Mike
    Attached Files Attached Files

  7. #7
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,640

    Re: Vlookup with named range

    Ok, I can't count

    It should've been 3 not 4 at the end..

    ='UPC SCANS'!$B$2:INDEX('UPC SCANS'!$B$2:$D$1000,COUNTA('UPC SCANS'!$B$2:$B$1000),3)
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

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

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

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  8. #8
    Valued Forum Contributor realniceguy5000's Avatar
    Join Date
    03-20-2008
    Location
    PA
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    926

    Re: Vlookup with named range

    Thanks, it appears to be working now,

    With all the changes I tried with that formula, I wonder why I never tried a 3 is beyond me. In my mind it was a 1

    Anyway I hope that my formula troubles are not wearing off on you... lol

    Thanks Again...Mike
    Thank You, Mike

    Some Helpful Hints:

    1. New members please read & follow the Forum Rules
    2. Use Code Tags...Place[code]Before the first line and[/code] After the last line.
    3. If you are pleased with a solution mark your post SOLVED.
    4. Thank those who have help you by clicking the scales at the top right of the post.

    Here...

  9. #9
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,640

    Re: Vlookup with named range

    It is 3 because you are indexing this range: 'UPC SCANS'!$B$2:$D$1000

    and in you want to go from column B to column D which is 3 columns away... i.e. the range you want to name is 3 columns wide.
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

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

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

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

+ 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.2.0