+ Reply to Thread
Results 1 to 13 of 13

Need Formula to find the match then copy & paster number

  1. #1
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    810

    Need Formula to find the match then copy & paster number

    Hello All,
    I'm looking for the Formula to find the match between 2 ws, if there's any matches then copy and paste the number base on the select range. Please take a look at sample in attached for more clear.

    Regards,
    tt3
    Attached Files Attached Files
    Last edited by tuongtu3; 10-27-2013 at 07:39 PM. Reason: Solved

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Need Formula to find the match then copy & paster number

    hi tt3. try this in W2:
    =IFERROR(LOOKUP(2,1/((Sheet2!$G$2:$G$20=F2)*(Sheet2!$M$2:$M$20<=X2)),Sheet2!$R$2:$R$20),0)

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    810

    Re: Need Formula to find the match then copy & paster number

    Hi benishiryo,
    The code works perfect. I don't understand at all why it work when I look at the formula. Ca you explain a little so I can learn.

    Regards,
    tt3

  4. #4
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    810

    Re: Need Formula to find the match then copy & paster number

    Hi benishiryo,
    Just found out that the formula return value form the bottom to top. Is there any way to search the value from top to bottom or I have to sort value from small to larger.

    To ensure the formula work correct I would like to matches the third column and please look at revise-sample in attached.

    Regards,
    tt3

    Regards,
    tt3
    Attached Files Attached Files
    Last edited by tuongtu3; 10-17-2013 at 11:00 AM.

  5. #5
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    810

    Re: Need Formula to find the match then copy & paster number

    Hi benishiryo,
    Just found out that the formula does not get result when qty does not match. Please take a look at cell W3 and W16 in attahcced file.

    Regards,
    tt3

  6. #6
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    810

    Re: Need Formula to find the match then copy & paster number

    Hi benishiryo,
    Just found out that the formula does not get result when qty does not match. Please take a look at cell W3 and W16 in attached file.

    Regards,
    tt3
    Attached Files Attached Files

  7. #7
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Need Formula to find the match then copy & paster number

    Quote Originally Posted by tuongtu3 View Post
    Hi benishiryo,
    Just found out that the formula does not get result when qty does not match. Please take a look at cell W3 and W16 in attached file.

    Regards,
    tt3
    Maybe conditions of the data rather ambiguous? "cell W16 should be 1" Why?
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  8. #8
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    810

    Re: Need Formula to find the match then copy & paster number

    Hi AlKey,
    "cell W16 should be 1" Why?
    I would like to scan the result from top to bottom but I can solve this issue by sorting value from Largest to smallest.

    How about the Cell W3? It would be perfect if it can scan and get the value of 99 (Currently I have to use another step of formula Vlookup).

    Regards,
    tt3

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Need Formula to find the match then copy & paster number

    Try this approach using a helper column on sheet2 (I used W)...
    copy this to W2 and copy down...
    =G2&COUNTIF($G$2:G2,G2)
    Then use this on sheet1 to pull in the values...
    =IFERROR(INDEX(Sheet2!$R$2:$R$20,MATCH(Sheet1!F2&COUNTIF(Sheet1!$F$2:F2,Sheet1!F2),Sheet2!$W$2:$W$20,0)),"")
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  10. #10
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Need Formula to find the match then copy & paster number

    This will get value 99

    =IFERROR(LOOKUP(2,1/((Sheet2!$G$2:$G$24=F2)*(Sheet2!$M$2:$M$24<=X2)),Sheet2!$R$2:$R$24),IFERROR(VLOOKUP(F2,Sheet2!$G$2:$R$24,12,0),0))

  11. #11
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    810

    Re: Need Formula to find the match then copy & paster number

    @DibBins: Formula does not work properly at W2, W3, W9, W13, W14, W16.
    @AlKey: Formula works perfect.

    Regards.
    tt3

  12. #12
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Need Formula to find the match then copy & paster number

    You're welcome. Don't forget to thank those who helped by clicking on Add Reputation * and please mark thread as "Solved" if your issue has been resolved. (Selecting Thread Tools-> Mark thread as Solved).

  13. #13
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    810

    Re: Need Formula to find the match then copy & paster number

    Thank you very much for all of your time and help.
    Reputation has been added.
    Regards,
    tt3

+ 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. [SOLVED] How to select certain rows then copy/paster to new wb
    By tuongtu3 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-20-2013, 06:08 PM
  2. [SOLVED] Find match, find related cell and return that number
    By HelpHelpHelp in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-17-2012, 06:46 AM
  3. Replies: 5
    Last Post: 02-29-2012, 08:51 PM
  4. Copy and Paster an autosum to new workbook
    By pauldaddyadams in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-03-2008, 06:06 AM
  5. [SOLVED] I've just lost my ability to copy and paster in Excel.
    By leprechaun in forum Excel General
    Replies: 0
    Last Post: 11-30-2005, 09:55 AM

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