+ Reply to Thread
Results 1 to 10 of 10

Copy data from Sheet b to Sheet A, based on the existing contents of Sheet A

  1. #1
    Registered User
    Join Date
    03-01-2022
    Location
    Indonesia
    MS-Off Ver
    Office 365
    Posts
    12

    Copy data from Sheet b to Sheet A, based on the existing contents of Sheet A

    Hi,
    I have a question regarding Office Scripts in Excel Online, on how to conditionally copy data from one Sheet (Lets just Say Sheet A) to another sheet (Sheet B), if the value meets certain criteria in SheetB. For example:
    Sheet A Columns : Name (name of the person) , Age (age of the person) , Fail/Pass (value will be either fail or pass)
    Sheet B Columns: Name (name of person), Subject (Subject taken), score (value of the score of the subject)
    I would like copy the name values from Sheet B to Sheet A, if the name already exists in Sheet A AND the Fail/Pass value in sheet A for the person is also Pass. Please do note that the name on sheet B can appear more than once and I would like to copy all of the values (Therefore for example if a person named "James" match the criteria from Sheet A, and "James" appeared in Sheet B 3 times, I want to copy all 3 instances of "James" as well as the subject and Score values from Sheet B to Sheet A

    Any solutions is welcome (including formulas) or using Office Scripts, however, it must be implemented in excel online and therefore VBA/macros cannot be used.

    EDIT: I've added a sample file with Sheet A, Sheet B and expected result that will be shown in Sheet A.

    Thank you!
    Attached Files Attached Files
    Last edited by patrickrw99; 03-01-2022 at 04:51 AM. Reason: Added sample file

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Copy data from Sheet b to Sheet A, based on the existing contents of Sheet A

    Output in F1,
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    03-01-2022
    Location
    Indonesia
    MS-Off Ver
    Office 365
    Posts
    12

    Re: Copy data from Sheet b to Sheet A, based on the existing contents of Sheet A

    Quote Originally Posted by jindon View Post
    Output in F1,
    Please Login or Register  to view this content.
    Hi unfortunately as the original post stated, I cannot use macro or VBA, and must use office script/any type of excel formula as i am using excel online. Therefore any solution using office script is very much appreciated

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Copy data from Sheet b to Sheet A, based on the existing contents of Sheet A

    Ahhh, I missed it...

  5. #5
    Registered User
    Join Date
    03-01-2022
    Location
    Indonesia
    MS-Off Ver
    Office 365
    Posts
    12

    Re: Copy data from Sheet b to Sheet A, based on the existing contents of Sheet A

    Quote Originally Posted by jindon View Post
    Ahhh, I missed it...
    No worries, thank you for trying to help, if you know the solution using Office Scripts/any regular formulas, please let me know thank you!

  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,756

    Re: Copy data from Sheet b to Sheet A, based on the existing contents of Sheet A

    Thread has been moved to the Formulas & Functions section - don't post in the VBA section if you can't accept a VBA solution!!!
    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
    03-01-2022
    Location
    Indonesia
    MS-Off Ver
    Office 365
    Posts
    12

    Re: Copy data from Sheet b to Sheet A, based on the existing contents of Sheet A

    Hi I'm sorry that I put this thread in the VBA Section, but as I recall Office Scripts is a part of Excel programming, and I explicitly stated that I was also open to any solutions using office Scripts. Therefore I don't see a problem with me putting this thread in the Excel Programming Section, and please do note as well that I've also stated that Formulas and functions are only one of the solutions that I am also open to, I never stated the solution must be in the form of formula.

  8. #8
    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,756

    Re: Copy data from Sheet b to Sheet A, based on the existing contents of Sheet A

    However, you also stated in your duplicate thread that you felt the thread would be better placed in this section (Formulas & Functions), and I have decided that this is correct. If you want to flag Office Scripts, then add this to the title of the opening post.

    You are, of course, completely missing the point: duplicate threads are not allowed.

  9. #9
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Copy data from Sheet b to Sheet A, based on the existing contents of Sheet A

    Quote Originally Posted by patrickrw99 View Post
    Hi unfortunately as the original post stated, I cannot use macro or VBA, and must use office script/any type of excel formula as i am using excel online. Therefore any solution using office script is very much appreciated
    Don't know if this works(tested and working here)

    A6:
    =LET(x,FILTER($A$2:$A$4,$B$2:$B$4="Pass"),FILTER(SheetB!A$2:A$6,ISNUMBER(MATCH(SheetB!$A$2:$A$6,x,0))))
    Copy to then right.

  10. #10
    Registered User
    Join Date
    03-01-2022
    Location
    Indonesia
    MS-Off Ver
    Office 365
    Posts
    12

    Re: Copy data from Sheet b to Sheet A, based on the existing contents of Sheet A

    WOW! Thank you very much for the help. The formula worked and you've been very helpful! Once again, thank you!

+ 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. Log Cell Changes of Existing Data in Sheet 1 and Copy Entire Row in Sheet 2
    By Malou in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-06-2022, 07:41 PM
  2. Replies: 2
    Last Post: 01-23-2016, 01:16 PM
  3. Replies: 6
    Last Post: 10-29-2014, 06:00 AM
  4. Replies: 1
    Last Post: 09-15-2014, 01:03 PM
  5. [SOLVED] Copy and paste data from sheet 2 to sheet 1 based on specific criteria on sheet 1
    By VBADUD in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-05-2012, 04:18 AM
  6. [SOLVED] Macro to Copy Data from one Sheet A to Sheet B based on value in cell on sheet A
    By scass in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-11-2012, 07:21 PM
  7. [SOLVED] [SOLVED] Copy the entire sheet to overlay existing sheet?
    By LurfysMa in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 08-29-2005, 03:05 PM

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