+ Reply to Thread
Results 1 to 12 of 12

I need to automatically retrieve data relating to a product code upon entry.

  1. #1
    Registered User
    Join Date
    08-27-2012
    Location
    Cape Town, South Africa
    MS-Off Ver
    Excel 2007
    Posts
    10

    Lightbulb I need to automatically retrieve data relating to a product code upon entry.

    The database I am currently working with is on sheet1 and shown in the picture below:

    data.jpg

    On sheet 2 I have an order form which looks like this:

    order.jpg

    Our customers browse our products online in the form of pictures (.jpegs). These .jpegs display the information of the product as well as the product code. We have created an order form which has a table representing the same information as displayed in the .jpeg.

    When I enter the product code on the order form, I would like the rest of the product information (description, colour, material etc.) to be pulled up from the relevant record in sheet1
    E.g I enter M673 under code on my order form and a formula automatically pulls up the rest of the information about the specified product.

    Like this:

    Code Description Material Size Quan PP Price
    M673 EMBOSSED STARS MOBILES sparkle silver 125mm 1 R59.00


    The problem is, is that I am new to excel and have no knowledge about how to create a working formula. If you have the time, explaining how you created your formula would also be fantastic. Any help is greatly appreciated

    Regards,
    Kyle
    Last edited by Kylemarc; 08-27-2012 at 08:53 AM.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,723

    Re: I need to automatically retrieve data relating to a product code upon entry.

    You don't have Colour as one of the fields in your database.

    You can do this using VLOOKUP - put this formula in B20 of your order form:

    =IF(A20="","",VLOOKUP($A20,Sheet1!$A:$F,column(),0))

    This can then be copied across and down.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    08-27-2012
    Location
    Cape Town, South Africa
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: I need to automatically retrieve data relating to a product code upon entry.

    Thanks very much for the reply Pete_UK

    I am doing my best to make sense of the formula and your advice, but as previously stated I am very unskilled when it comes to excel as I do not have much prior experience.
    What do you mean by I have no colour as one of the fields in my database? And what relevance does it have to the functioning of the formula?

    If you would, please explain the parts of the formula and what each one refers to.

    Regards,
    Kyle

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,723

    Re: I need to automatically retrieve data relating to a product code upon entry.

    In your order form your have a columns for Material, Colour and Size - Material can be obtained from column C of your database and Size is in column D of your database, but there is nothing to give your the Colour information. In your example table above your have 125mm shown under Colour with a Size of 1, so your example is inconsistent.

    I've noticed that you are using merged cells in your order form, so the formula that I gave you will not work. You will have to put this formula in B20:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    and this one in F20:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    G20 would have to be left empty as there is nowhere to get that data from, then you could put this in H20:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    and in I20 you can have this:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    and finally you can put this one in J20:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Notice that these formulae are very similar - the only thing that changes is the 3rd parameter within the VLOOKUP function, as this relates the column number where you want to get the data from.

    VLOOKUP has up to 4 parameters, and allows you to retrieve data from a table. The first parameter is the lookup value - the value that you want to find in the table and in this case is the code that can be found in A20. The second parameter defines where the data can be found, and in this case it is columns A to F on Sheet1. The function works by searching through the left-most column of the table (column A of Sheet1) looking for a matching entry. If a match is found then it returns the corresponding value on the same row of the table in the column given by the third parameter. The final parameter defines the type of match which is looked for - a 0 (or FALSE) indicates an exact match.

    Anyway, the formulae that I have given above can then be copied down on your order form to allow other items to be ordered.

    Hope this helps.

    Pete

  5. #5
    Registered User
    Join Date
    08-27-2012
    Location
    Cape Town, South Africa
    MS-Off Ver
    Excel 2007
    Posts
    10

    Smile Re: I need to automatically retrieve data relating to a product code upon entry.

    Thank you Pete. It is working perfectly - and now I have learned a new trick too!

    -- The colour column in the table was an error, sorry!
    Last edited by Kylemarc; 08-27-2012 at 08:54 AM.

  6. #6
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: I need to automatically retrieve data relating to a product code upon entry.

    @ Kylemarc

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

  7. #7
    Registered User
    Join Date
    08-27-2012
    Location
    Cape Town, South Africa
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: I need to automatically retrieve data relating to a product code upon entry.

    Thank you Cutter, I will keep all of that in mind for future posts. Thanks for a great forum.

  8. #8
    Registered User
    Join Date
    08-27-2012
    Location
    Cape Town, South Africa
    MS-Off Ver
    Excel 2007
    Posts
    10

    Lightbulb Re: I need to automatically retrieve data relating to a product code upon entry.

    New information: The product information and the order form have changed slightly. All my attempts to edit the previously working formula have not yielded the desired results. I now need a new formula to do the following:

    The new product information is attached in the image below. (Column 1: Code, Column 2: Description, Column 3: Colour and material, Column 4: Size, Column 5: Quantity **PER PACKET**, Column 6: Price)

    NewData.jpg

    The new order form is attached below:

    NewOrderForm.jpg

    As stated in my preceding posts, the customers browse pictures on our website which display the information of each product. What we are trying to create is an order form which does all the work for the customer by bringing all relevant information about products and prices to the order form for them and saves everyone a lot of time and confusion.

    I would like a formula that I can paste into each cell within the red square so that when the product code is entered into the code column, all the columns within the boundaries of the red square relating to that product code is automatically found in sheet1 and brought to the correct row.

    I hope I have explained this well enough as my excel terms are very limited. Please ask if any clarification is necessary.

    Appreciate all of the help!

    Regards,
    Kyle
    Attached Images Attached Images

  9. #9
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,723

    Re: I need to automatically retrieve data relating to a product code upon entry.

    Put this formula in C20:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    then copy across into D20:G20. Then copy C20:G20 down to the bottom of your red square.

    Hope this helps.

    Pete

  10. #10
    Registered User
    Join Date
    08-27-2012
    Location
    Cape Town, South Africa
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: I need to automatically retrieve data relating to a product code upon entry.

    Pete to the rescue! Works like a charm. THANK YOU PETE_UK.

  11. #11
    Registered User
    Join Date
    08-12-2013
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: I need to automatically retrieve data relating to a product code upon entry.

    Hi Pete,

    I also need help with something similar. But I have tried to use this as an example but I just cant seem to get the formula correct.
    I dont know where im going wrong?? Please help!!

    Capture.PNG

    Capture 2.PNG

    by putting the product code in on the second attachment, the description of goods should automatically appear.

    Thank you in Advance



    Quote Originally Posted by Pete_UK View Post
    In your order form your have a columns for Material, Colour and Size - Material can be obtained from column C of your database and Size is in column D of your database, but there is nothing to give your the Colour information. In your example table above your have 125mm shown under Colour with a Size of 1, so your example is inconsistent.

    I've noticed that you are using merged cells in your order form, so the formula that I gave you will not work. You will have to put this formula in B20:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    and this one in F20:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    G20 would have to be left empty as there is nowhere to get that data from, then you could put this in H20:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    and in I20 you can have this:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    and finally you can put this one in J20:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Notice that these formulae are very similar - the only thing that changes is the 3rd parameter within the VLOOKUP function, as this relates the column number where you want to get the data from.

    VLOOKUP has up to 4 parameters, and allows you to retrieve data from a table. The first parameter is the lookup value - the value that you want to find in the table and in this case is the code that can be found in A20. The second parameter defines where the data can be found, and in this case it is columns A to F on Sheet1. The function works by searching through the left-most column of the table (column A of Sheet1) looking for a matching entry. If a match is found then it returns the corresponding value on the same row of the table in the column given by the third parameter. The final parameter defines the type of match which is looked for - a 0 (or FALSE) indicates an exact match.

    Anyway, the formulae that I have given above can then be copied down on your order form to allow other items to be ordered.

    Hope this helps.

    Pete

  12. #12
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: I need to automatically retrieve data relating to a product code upon entry.

    Dee-Dee,

    Unfortunately you need to post your question in a new thread, it's against the forum rules to post a question in the thread of another user. If you create your own thread, any advice will be tailored to your situation so you should include a description of what you've done and are trying to do. Also, if you feel that this thread is particularly relevant to what you are trying to do, you can surely include a link to it in your new thread.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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