+ Reply to Thread
Results 1 to 12 of 12

Searching another sheet to plug in values

  1. #1
    Registered User
    Join Date
    12-07-2009
    Location
    sacramento, ca
    MS-Off Ver
    Excel 2003
    Posts
    5

    Searching another sheet to plug in values

    Hello,


    I am trying to create a sheet for invoicing. I have a sheet I want to use as a database. I want to search the database from the "invoice" sheet and fill the fields once i have found what I am looking for.

    attached is a sample database I will use. I dont want to use the whole row, only selected colums. for example short_item description, item_number, Brand, SRP, ect. I want to search on the "invoice" sheet, for example, item description,and fill out the rest of the necessary fields in that row with data from my "database".

    what formula or macro can I use to acheive this?
    Attached Files Attached Files

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: Searching another sheet to plug in values

    Where is the Invoice sheet?

  3. #3
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Searching another sheet to plug in values

    Hi,

    your solution is called VLookup()

    In your invoice sheet enter the ItemId in a cell, say A1 = 7645

    Then, to find the short description, which is in the 5th column in the database filled with data up to row 100, use

    =VLOOKUP(A1,Sheet1!$a$2:$ap$100,5,FALSE)

    hth

  4. #4
    Registered User
    Join Date
    12-07-2009
    Location
    sacramento, ca
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Searching another sheet to plug in values

    Quote Originally Posted by davesexcel View Post
    Where is the Invoice sheet?


    sample invoice now with sample database
    Attached Files Attached Files

  5. #5
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Searching another sheet to plug in values

    in that case in C5 and copy down

    =IF(ISBLANK(B5),"",VLOOKUP(B5,database!$A$2:$AP$100,5,FALSE))

    You have to decide which field should be the key and which should be the calculated value. Item number makes sense as the key, since this is how your database is organised, too.

    Other solutions are possible. The same formula can be applied to retail price, just change the column number (the red bit in my earlier post). I couldn't identify which column holds the retail price, but I'm sure you will.

    cheers

  6. #6
    Registered User
    Join Date
    12-07-2009
    Location
    sacramento, ca
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Searching another sheet to plug in values

    sorry for the basic references i'm making. but, I would I would like to search the short_desc and fill out the rest of the fields I "will" have in the invoice.

    so, If i search in the "invoice" under description I type in "air pump" I want to invoice to be filled out with description, manufacture,item number, retail price,wholesale cost,ect. it seems like vlookup can only search one key and return value. but, I want to search one key and return mutiple values to fill out the invoice. does this make sence, and is it possible?
    Last edited by shg; 12-07-2009 at 11:16 PM. Reason: deleted spurious quote

  7. #7
    Registered User
    Join Date
    12-06-2009
    Location
    Monroe, Louisiana
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    31

    Re: Searching another sheet to plug in values

    If I am understanding you correctly, you are wanting to use the "short description" as your Lookup Value. If so, you will need to move the Short Description from Column 5, (E) to Column 1, (A). The VLOOKUP function searches the leftmost column for the match. Secondly, the text that you type in to search has to match exactly in order for it to work. Depending on the number of items you have, it may be a good idea to use Data Validation to select from a list, that way the spelling will match and that will not be an issue.
    Last edited by shg; 12-07-2009 at 11:17 PM. Reason: deleted spurious quote

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Searching another sheet to plug in values

    Folks, please don't quote whole posts. It just clutters the forum.

    Thanks.
    Entia non sunt multiplicanda sine necessitate

  9. #9
    Registered User
    Join Date
    12-06-2009
    Location
    Monroe, Louisiana
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    31

    Re: Searching another sheet to plug in values

    See if this is what you are looking for. I added a test line to show you the change. If this is what you are looking for, then you can use other functions to calculate given quantity and tax to give you a total. You would want to hide Column H once you got your invoice how you want it.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    12-07-2009
    Location
    sacramento, ca
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Searching another sheet to plug in values

    MattVarnell

    yes this is exactly what I am looking for.

    how do I code for the data validation?

    I'll put together a final version of what I want and upload it.

  11. #11
    Registered User
    Join Date
    12-07-2009
    Location
    sacramento, ca
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Searching another sheet to plug in values

    here is the invoice layout I will use, along with the final database.
    Attached Files Attached Files

  12. #12
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: Searching another sheet to plug in values

    It should work, you probably will have to change the workbook name to
    Please Login or Register  to view this content.

+ 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