+ Reply to Thread
Results 1 to 5 of 5

compare delete and sort the data in excel with two sheets

Hybrid View

  1. #1
    Registered User
    Join Date
    07-08-2012
    Location
    chennai
    MS-Off Ver
    Excel 2019
    Posts
    77

    compare delete and sort the data in excel with two sheets

    Hi,

    I have a data in two sheets named as Sheet 1 & Sheet 2.

    My requirement is compare the two sheets ie Sheet 1 & Sheet 2 based on the Student ID and delete the non unique values with full rows data in both the sheets ie. sheet 1 & sheet 2 based on student ID and Delete.

    Once deleted the non unique values then sort the data in ascending order based on the student id

    Attaching the sample data for your reference

    Thanks
    Webmax
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2507 Win 11
    Posts
    24,918

    Re: compare delete and sort the data in excel with two sheets

    I am guessing at what you want your result to look like since you did not provide a mocked up solution. Here is a solution using Power Query

    let
        T1= Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
        T2= Excel.CurrentWorkbook(){[Name="Table2"]}[Content],
        MQ = Table.NestedJoin(T1, {"Student ID"}, T2, {"Student ID"}, "T3", JoinKind.FullOuter),
        #"Expanded T3" = Table.ExpandTableColumn(MQ, "T3", {"Student ID", "Name", "Mark1", "Mark 2"}, {"Student ID.1", "Name.1", "Mark1.1", "Mark 2.1"}),
        #"Filtered Rows" = Table.SelectRows(#"Expanded T3", each ([Student ID] <> null) and ([Student ID.1] <> null))
    
    
    in
        #"Filtered Rows"
    Attached Files Attached Files
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    07-08-2012
    Location
    chennai
    MS-Off Ver
    Excel 2019
    Posts
    77

    Re: compare delete and sort the data in excel with two sheets

    Hi,
    I want in vba macro and also not to add separate sheet in Sheet 1 and sheet 2 and non unique data to delete and sort based on student id

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    31,223

    Re: compare delete and sort the data in excel with two sheets

    Please show expected results.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2507 Win 11
    Posts
    24,918

    Re: compare delete and sort the data in excel with two sheets

    Power Query is a free AddIn for Excel 2010 and 2013, and is built-in functionality from Excel 2016 onwards (where it is referred to as "Get & Transform Data").

    It is a powerful yet simple way of getting, changing and using data from a broad variety of sources, creating steps which may be easily repeated and refreshed. I strongly recommend learning how to use Power Query - it's among the most powerful functionalities of Excel.

    - Follow this link to learn how to install Power Query in Excel 2010 / 2013.

    - Follow this link for an introduction to Power Query functionality.

    - Follow this link for a video which demonstrates how to use Power Query code provided.

+ 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. compare between two sheets and delete and sort again
    By ABDELFATTA in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-17-2022, 12:20 PM
  2. Compare 2 sheets then delete data but only if dates longer than 7 days
    By tweacle in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-17-2022, 10:46 AM
  3. macro to compare data sort and delete buys vs sells
    By maulik1k in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-11-2013, 04:35 AM
  4. [SOLVED] Code to compare data in 2 sheets and delete duplicates
    By amar05 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-13-2013, 03:24 PM
  5. Compare two columns from diff excel sheets and delete all non matching rows
    By Girija in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-24-2013, 11:08 PM
  6. [SOLVED] Help me Sort, compare and delete
    By kwesi2505 in forum Excel Programming / VBA / Macros
    Replies: 41
    Last Post: 02-12-2013, 02:09 PM
  7. Compare Data in 2 sheets and delete or move rows
    By tracktor in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-21-2011, 12:21 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