+ Reply to Thread
Results 1 to 6 of 6

copy and paste if match and product

  1. #1
    Registered User
    Join Date
    10-07-2016
    Location
    winsted CT
    MS-Off Ver
    2010
    Posts
    31

    copy and paste if match and product

    Unfortunately I cannot post even an image yet to this forum, but I will try and explain as best I could. I have a master column of part numbers with corresponding qty., then a column of order #'s of some of those part numbers(in next column) and order p/n qty's in next column. What I need, is to lookup if the ordered part number is in the master p/n list, and compare if the ordered qty is equal to or greater than the master p/n qty, if this is true, then paste the order number, p/n, and qty. I hope this makes sense, perhaps I can send the file in a message if someone has an idea on how to do this. I was trying all kinds of VLOOKUP, and IF formulas, but cannot get one that does what I need. Thanks in advance.


    MASTER P/N QTY ord # p/n orders qty
    554842 249 0004049376 69494R211 100.000
    546361 636 0004046691 557034 11.000
    514795-2 14 0004046779 537822 291.000
    557928 10 0004048385 764329-2 16.000

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: copy and paste if match and product

    Please don't try to post an image. They're pretty much useless.
    Will you please attach a sample Excel workbook? Please don't attach a picture of one.

    1. Make sure that your sample data are REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution is also shown (mock up the results manually).

    3. Make sure that all confidential information is removed first!!

    4. Try to avoid using merged cells. They cause lots of problems!

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Registered User
    Join Date
    10-07-2016
    Location
    winsted CT
    MS-Off Ver
    2010
    Posts
    31

    Re: copy and paste if match and product

    Ok, thanks Glenn. So in the attached, you can see two sets of data. Master part numbers and their annual quantities, and the other set of data has a snapshot of orders, and it has the order number, part number and its quantity. What I need, as I highlighted with colors to make it easier, is to look up the part number (yellow) and find it's match in the master part number, then, compare its quantity to the master quantity (both blue) to see if it is 50% or more of the master quantity. If the part number from the order is greater than 50%, then copy and paste the order number (green), if it is false, then n/a. I was able to do it but it uses the number in the same row, which the part numbers in each column are not in order, so that's useless. I have been trying VLOOKUP and then an IF > statement, but I cannot seem to get it to spit out a correct response. Like my last problem, if I were to do this manually, it would take days, as there are over 4000 part numbers, so a formula that I can drag down or a combination of formulas that get me to the order number that has a quantity greater than 50%, would be great and save a ton of time. Thanks again for any help or direction.
    Attached Files Attached Files
    Last edited by tavwtby; 10-17-2016 at 07:32 AM.

  4. #4
    Registered User
    Join Date
    10-07-2016
    Location
    winsted CT
    MS-Off Ver
    2010
    Posts
    31

    Re: copy and paste if match and product

    Well I tried to attach the file, and it shows that my attachment is there in my preview, but it is not showing up when I post. I am not sure what I can do to attach this file now

    Edit: I now see it has attached, so disregard this message.
    Last edited by tavwtby; 10-17-2016 at 07:53 AM.

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: copy and paste if match and product

    Unfortunately your data are in a bit of a mess. In column B, 514181 is stored as a number. in column E, it is stored as text that looks like a number. the BEST solution would be to ensure that BOTH columns are TEXT (this will allow leading zeros, etc, to be kept). It would enable this formula (which currently employs a rather ugly workaround) to be simplified.

    However, I'm not 100% certain that this is what you want (you did not show your expected results). Also, in one post you asked for the data to be copied if the ordered quantity was greater than stock, and in another post, you asked for the data to be copied if the ordered quantity was 50% or more than stock. Which is it to be? It's currently set at 50%...
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    10-07-2016
    Location
    winsted CT
    MS-Off Ver
    2010
    Posts
    31

    Re: copy and paste if match and product

    Sorry if I didn't articulate what I wanted clearly, but I will try to sum it up again. I need to search the master list of p/n's for the ordered p/n, it will be there, and then, if the ordered quantity is 50% or more of the master quantity, I want the order number pasted in the column. If you look at the snippet I attached, the yellow highlighted p/n's are compared, and one of them has an ordered qty. of over 50%, therefore the order # is listed, the other ordered p/n does not have an ordered qty that's 50% or more, thus n/a is listed. I also didn't realize that the column was formatted as text and not number, so thanks, I will correct that.
    But I tried the formula that you gave me and so far it works, so problem solved, for now. I will apply it to the main spreadsheet and check it, and let you know if there are any issues, but thank you very much Glenn, I appreciate it greatly, saved me tons of time.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Macro If value Match copy row and paste to Match Value
    By kannan1847 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-16-2015, 08:34 AM
  2. [SOLVED] Way to match, copy, and paste?
    By DSGunny in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 07-29-2015, 04:13 PM
  3. [SOLVED] Find Product Details in Another Sheet based on Product ID and Copy some Fields From there
    By kevalkothari in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-29-2012, 10:43 AM
  4. Match, Copy and paste from another spreadsheet
    By DaPro in forum Excel - New Users/Basics
    Replies: 8
    Last Post: 04-29-2011, 04:27 PM
  5. Macro Help - Match Copy & Paste
    By gotovamsee in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-04-2011, 07:03 AM
  6. match product id with product name from other workbook
    By mustangfanatic in forum Excel Formulas & Functions
    Replies: 20
    Last Post: 07-22-2008, 03:37 PM
  7. [SOLVED] help with match, copy, paste please
    By Mona in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-19-2006, 09:40 PM

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