+ Reply to Thread
Results 1 to 11 of 11

Vlookup

  1. #1
    Registered User
    Join Date
    09-10-2011
    Location
    Battle Creek, MI
    MS-Off Ver
    Excel 2011
    Posts
    9

    Vlookup

    I am looking for a way to use a VLOOKUP. What I am trying to do is have a VLOOKUP value for a piece of equipment. But what I would like to do is have the value it would be trying to lookup be like "PU202" but I don't want to have to create a table that has all of my equipment and their truck numbers. I just want to have a table that says the rate for this type of equipment. And not all of the equipment #'s.

    If I made a table and the PU column said PU000 would the VLOOKUP function be able to lookup PU202 on a table that only says PU000 or PUXXX or something like that?


    Thanks in advance.

    Brian
    Last edited by NBVC; 09-16-2011 at 10:58 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    08-22-2011
    Location
    Auckland
    MS-Off Ver
    Excel 2019
    Posts
    716

    Re: VLOOKUP Question... Help

    Hello Brian
    Is this the sort of thing you're looking for?
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    09-10-2011
    Location
    Battle Creek, MI
    MS-Off Ver
    Excel 2011
    Posts
    9

    Re: VLOOKUP Question... Help

    No, Thats what I don't want to do though. I want to be able to do something like I attached. On one sheet I want to have the VLOOKUP lookup the truck rate. But I want it to lookup PU 124 where there will be no PU 124 in the table.

    Thanks,
    Brian
    Attached Files Attached Files

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

    Re: VLOOKUP Question... Help

    Try:

    =VLOOKUP("*"&LEFT(B5,FIND(" ",B5)-1)&"*",Rates!$C$5:$D$6,2,FALSE)

    copied down and to next column(s)
    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.

  5. #5
    Registered User
    Join Date
    09-10-2011
    Location
    Battle Creek, MI
    MS-Off Ver
    Excel 2011
    Posts
    9

    Re: VLOOKUP Question... Help

    Quote Originally Posted by NBVC View Post
    Try:

    =VLOOKUP("*"&LEFT(B5,FIND(" ",B5)-1)&"*",Rates!$C$5:$D$6,2,FALSE)

    copied down and to next column(s)
    Can you explain what all that means... HAHA.. just so I know what I am doing.


    Thanks,
    Brian

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

    Re: VLOOKUP Question... Help

    This part: LEFT(B5,FIND(" ",B5)-1) is extract the left side of B5 to where it Finds a space in B5, FIND(" ",B5)-1 finds the space and goes back one so that the space is not part of what is extracted.

    The * are wildcards and when on both sides of a value means "contains"...

    So Vlookup in your table where the lookup column contains the left side (upto the space) of B5 contents.

  7. #7
    Registered User
    Join Date
    09-10-2011
    Location
    Battle Creek, MI
    MS-Off Ver
    Excel 2011
    Posts
    9

    Re: VLOOKUP Question... Help

    One more question, how can I add to that formula to make it equal 0 if there is nothing for it to look up?

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

    Re: VLOOKUP Question... Help

    You mean in B5 is blank?

    =IF(B5="",0,VLOOKUP("*"&LEFT(B5,FIND(" ",B5)-1)&"*",Rates!$C$5:$D$6,2,FALSE))

  9. #9
    Registered User
    Join Date
    09-10-2011
    Location
    Battle Creek, MI
    MS-Off Ver
    Excel 2011
    Posts
    9

    Re: VLOOKUP Question... Help

    Quote Originally Posted by NBVC View Post
    You mean in B5 is blank?

    =IF(B5="",0,VLOOKUP("*"&LEFT(B5,FIND(" ",B5)-1)&"*",Rates!$C$5:$D$6,2,FALSE))
    Exactly, Thank You very much!!!

  10. #10
    Registered User
    Join Date
    09-10-2011
    Location
    Battle Creek, MI
    MS-Off Ver
    Excel 2011
    Posts
    9

    Re: VLOOKUP Question... Help

    Is there any way to leave the spot blank instead of a 0, if B5 is blank?

  11. #11
    Registered User
    Join Date
    09-10-2011
    Location
    Battle Creek, MI
    MS-Off Ver
    Excel 2011
    Posts
    9

    Re: Vlookup

    nvrmind got that too. thanks

+ 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