+ Reply to Thread
Results 1 to 14 of 14

Copying data based on criteria

  1. #1
    Registered User
    Join Date
    10-27-2019
    Location
    Slovenia
    MS-Off Ver
    365
    Posts
    7

    Copying data based on criteria

    Hello everybody,

    I have a big excel file (around 7600 rows) which contains information about online store products. I would like to update the stock numbers of the products. The new stock numbers come from another excel file which I got from the supplier. The SKUs of the products are the same and are found in column A in both files. However, the number of rows and the order is not the same so I can't simply copy and paste the desired data. The new stock numbers are found in column H of the second file and I would like to copy them into column S of my file.

    I hope someone can help me with this.

    Thank you for your answers.

    Best regards,

    Sašo
    Attached Files Attached Files

  2. #2
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Copying data based on criteria

    One way, untested:
    Please Login or Register  to view this content.
    Change the colored part as per your actual files
    Click the * to say thanks.

  3. #3
    Registered User
    Join Date
    10-27-2019
    Location
    Slovenia
    MS-Off Ver
    365
    Posts
    7

    Re: Copying data based on criteria

    Hello Paul,

    Thank you for your reply.

    If I understand correctly, the blue part should be replaced with file path of the suppliers file, the green part should be the name of the sheet in my file and the red part should be the name of the sheet in supplier's file?

    Would this be easier if I simply copy the data from supplier's file and add it to a second sheet in my own file?

  4. #4
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Copying data based on criteria

    You are correct. It could be simpler. and if are gonna do it manually, then you will need just a vlookup to make it work.

  5. #5
    Registered User
    Join Date
    10-27-2019
    Location
    Slovenia
    MS-Off Ver
    365
    Posts
    7

    Re: Copying data based on criteria

    Would you be so kind and send me the formula that would do as described in my original post, keeping in mind that my data will be on Sheet 1 and suppliers data will be on Sheet 2 of the same file?

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,647

    Re: Copying data based on criteria

    You have posted in the VBA section, which is why you have been offered code - do you want a formula solution instead?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  7. #7
    Registered User
    Join Date
    10-27-2019
    Location
    Slovenia
    MS-Off Ver
    365
    Posts
    7

    Re: Copying data based on criteria

    I posted here because I started with two different files but figured that this could be much simpler if I simply combine both files into a single one with two sheets. If I am correct and a formula solution would be simpler, then yes I would like that one. Sorry for the confusion but I am a total n00b when it comes to Excel. All I know is that there a lot of things one can do with it.

  8. #8
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Copying data based on criteria

    In Sheet1 S2 and down =iferror(index(sheet2!$h:$h,match($A2,sheet2!$A:$A,0)),"")

  9. #9
    Registered User
    Join Date
    10-27-2019
    Location
    Slovenia
    MS-Off Ver
    365
    Posts
    7

    Re: Copying data based on criteria

    Thank you for the formula. However, Excel is returning error when trying to execute it.

  10. #10
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Copying data based on criteria

    Based on your sample:=IFERROR(INDEX('Suppliers data'!$H:$H,MATCH($A2,'Suppliers data'!$A:$A,0)),"")

  11. #11
    Registered User
    Join Date
    10-27-2019
    Location
    Slovenia
    MS-Off Ver
    365
    Posts
    7

    Re: Copying data based on criteria

    I've changed the name of the sheet when trying out the formula and I have now tried the second one. Still nothing.

  12. #12
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Copying data based on criteria


  13. #13
    Registered User
    Join Date
    10-27-2019
    Location
    Slovenia
    MS-Off Ver
    365
    Posts
    7

    Re: Copying data based on criteria

    Thanks for your help. I was following the tutorial to the letter but I can't get it to work no matter what I try. I even tried pasting the suppliers' data into my own sheet and still nothing.

  14. #14
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,647

    Re: Copying data based on criteria

    Are you getting an error message? Did you change commas to semi-colons for your locale?

    =IFERROR(INDEX('Suppliers data'!$H:$H;MATCH($A2;'Suppliers data'!$A:$A;0));"")

+ 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] Copying Data based on multiple criteria
    By ImranBhatti in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-29-2016, 02:01 PM
  2. [SOLVED] Copying data based on multiple criteria from one sheet to another
    By excellearner121 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-01-2014, 01:52 AM
  3. Replies: 4
    Last Post: 01-08-2013, 12:37 PM
  4. Copying Data into Template based on Criteria
    By esphero in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-20-2012, 10:48 PM
  5. [SOLVED] Copying Rows of Data Based on Criteria
    By harrydnyc in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-06-2011, 03:34 AM
  6. Copying data to another worksheet based on certain criteria
    By md1972 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-09-2008, 08:34 AM
  7. Replies: 1
    Last Post: 06-15-2006, 05:25 AM

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