+ Reply to Thread
Results 1 to 25 of 25

Advanced sorting/matching

  1. #1
    Registered User
    Join Date
    06-15-2024
    Location
    Kyrks?ter?ra, Norway
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2404 Build 16.0.17531.20190) 64-bit
    Posts
    10

    Advanced sorting/matching

    excel.jpg

    I could really use some help. I am trying to sort and match column B "into" column A. And I managed it with this formula: =IFNA(INDEX(B1:B15;XMATCH(A1:A15;B1:B15));"") that I have put in to column H.

    However, I need to get the data in column C & D to follow the sorting.. Any tips that could help me out?

    Marius

  2. #2
    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. 2407 (Windows 11 23H2 64-bit)
    Posts
    83,292

    Re: Advanced sorting/matching

    Welcome to the forum.

    There are instructions at the top of the page explaining how to attach your sample workbook (yellow banner: HOW TO ATTACH YOUR SAMPLE WORKBOOK). Screenshots are of little practical use as we cannot manipulate them.

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. The sample layout accurately matches that of your real data. It also has expected results mocked up, worked examples where required, relevant cells highlighted and a few explanatory notes.

    Administrative Note:

    Is your forum profile showing the Excel PRODUCT that you need this to work for?

    Members will tailor the solutions they offer to the Office PRODUCT (Excel, NOT Windows) that you have. Please check that your forum profile is up-to-date in this respect. If you aren't sure, in Excel go to File | Account and report what it says below the MS logo at the top of that page. If your product is for Mac, please also state this.

    The three most recent Excel products are Excel 2019, Excel 2021 and MS365 - if you are using MS365, please give this name along with the version number in your profile (e.g. MS365 Version 2306). This is in the About Excel section further down the Account page.

    Thanks.
    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.

  3. #3
    Registered User
    Join Date
    06-15-2024
    Location
    Kyrks?ter?ra, Norway
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2404 Build 16.0.17531.20190) 64-bit
    Posts
    10

    Re: Advanced sorting/matching

    Here is the spreadsheet attatched.
    Attached Files Attached Files

  4. #4
    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. 2407 (Windows 11 23H2 64-bit)
    Posts
    83,292

    Re: Advanced sorting/matching

    And your Excel version? Business means NOTHING.

    If you have 365 (update your profile, please), paste this into H1 and hit ENTER:

    Please Login or Register  to view this content.
    The results will spill down.
    Attached Files Attached Files
    Last edited by AliGW; 06-15-2024 at 02:14 AM. Reason: Workbook added.

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    45,081

    Re: Advanced sorting/matching

    In H1, copied down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  6. #6
    Registered User
    Join Date
    06-15-2024
    Location
    Kyrks?ter?ra, Norway
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2404 Build 16.0.17531.20190) 64-bit
    Posts
    10

    Re: Advanced sorting/matching

    Sorry! Version is updated now! I will try this formula in my bigger spreadsheet! Thank you!

  7. #7
    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. 2407 (Windows 11 23H2 64-bit)
    Posts
    83,292

    Re: Advanced sorting/matching

    Glad to have helped.

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED. You can also access the SOLVED tag by editing the opening post and choosing SOLVED from the drop-down to the left of the title box.

    Also, if you have not already done so, remember that you can reward anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.

  8. #8
    Registered User
    Join Date
    06-15-2024
    Location
    Kyrks?ter?ra, Norway
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2404 Build 16.0.17531.20190) 64-bit
    Posts
    10

    Re: Advanced sorting/matching

    This seems to be working, but the formula only returns #VALUE#, Not the cell data.
    Tips?

  9. #9
    Registered User
    Join Date
    06-15-2024
    Location
    Kyrks?ter?ra, Norway
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2404 Build 16.0.17531.20190) 64-bit
    Posts
    10

    Re: Advanced sorting/matching

    Quote Originally Posted by TMS View Post
    In H1, copied down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    This seems to be working, but the formula only returns #VALUE#, Not the cell data.
    Tips?

  10. #10
    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. 2407 (Windows 11 23H2 64-bit)
    Posts
    83,292

    Re: Advanced sorting/matching

    What is the problem with my formula??? Why has it been abandoned?

    TMS' formula added to the attached and working perfectly, but it has to be copied down - mine does not.

    If you need help adapting mine, just say.
    Attached Files Attached Files

  11. #11
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    45,081

    Re: Advanced sorting/matching

    Learning from Ali*. Slightly shorter version that won't need the ranges adjusted.

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    * Thanks for the TOCOL. Finally think I’m getting to grips with DROP/REDUCE

  12. #12
    Registered User
    Join Date
    06-15-2024
    Location
    Kyrks?ter?ra, Norway
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2404 Build 16.0.17531.20190) 64-bit
    Posts
    10

    Re: Advanced sorting/matching

    Skjermbilde 2024-06-15 091436.jpg

    I hope you don`t fell offended, I tried both suggested formulas.

    I need help adapting ur formula to to this spreadsheet setup.

    I need to match and sort column K, to the data in column B. Having the data in column L,M & N follow the sorting of column K.


    Thank you.

  13. #13
    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. 2407 (Windows 11 23H2 64-bit)
    Posts
    83,292

    Re: Advanced sorting/matching

    You can do it like this:

    Please Login or Register  to view this content.
    Pleae provide a more realistic sample workbook - I cannot troubleshoot a picture, but chances are you are not updating ranges correctly, or the real data is very dufferent.

  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. 2407 (Windows 11 23H2 64-bit)
    Posts
    83,292

    Re: Advanced sorting/matching

    I hope you don`t fell offended, I tried both suggested formulas.
    Nobody is offended.

    You haven't updated the ranges to match the real data - of course it won't work!

    Provide a more realistic workbook (desensitised).

  15. #15
    Registered User
    Join Date
    06-15-2024
    Location
    Kyrks?ter?ra, Norway
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2404 Build 16.0.17531.20190) 64-bit
    Posts
    10

    Re: Advanced sorting/matching

    I have tried updated the ranges, probably not correct though. I will make a small spreadsheet as an example so that you can see the issue.

  16. #16
    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. 2407 (Windows 11 23H2 64-bit)
    Posts
    83,292

    Re: Advanced sorting/matching

    OK - I'll adapt it for you.

  17. #17
    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. 2407 (Windows 11 23H2 64-bit)
    Posts
    83,292

    Re: Advanced sorting/matching

    Try this:

    Please Login or Register  to view this content.

  18. #18
    Registered User
    Join Date
    06-15-2024
    Location
    Kyrks?ter?ra, Norway
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2404 Build 16.0.17531.20190) 64-bit
    Posts
    10

    Re: Advanced sorting/matching

    I`ve tried to show you what I need here. The whole original spreadsheet is 10915 rows long. I need the data in Column K, to sort and match the data in Column B, which is a longer column with more data then K. I also need the data in column L,M & N to follow the sorting. Kinda like what I try to showcase in the attached spreadsheet.
    Attached Files Attached Files

  19. #19
    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. 2407 (Windows 11 23H2 64-bit)
    Posts
    83,292

    Re: Advanced sorting/matching

    In O2 (boerowing one bit from TMS):

    =IFNA(DROP(REDUCE(0,TOCOL(B2:B10000,1),LAMBDA(x,y,VSTACK(x,FILTER(K2:N10000,K2:K10000=y,"")&""))),1),"")

    In fact, extend the ranges thus:

    =IFNA(DROP(REDUCE(0,TOCOL(B2:B15000,1),LAMBDA(x,y,VSTACK(x,FILTER(K2:N15000,K2:K15000=y,"")&""))),1),"")
    Attached Files Attached Files
    Last edited by AliGW; 06-15-2024 at 03:39 AM. Reason: Typo fixed.

  20. #20
    Registered User
    Join Date
    06-15-2024
    Location
    Kyrks?ter?ra, Norway
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2404 Build 16.0.17531.20190) 64-bit
    Posts
    10

    Re: Advanced sorting/matching

    I have to change your formula to this to get it to work: =IFNA(DROP(REDUCE(0;TOCOL(B2:B10915;1);LAMBDA(x;y;VSTACK(x;FILTER(K2:N10915;K2:K10000=y;"")&"")));1);"")

    But that only returns #VALUE!

    Why is it I have to change , to ; to get formula to work?
    Last edited by AliGW; 06-15-2024 at 03:45 AM. Reason: Please don't quote unnecessarily - use the Quick Reply button instead.

  21. #21
    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. 2407 (Windows 11 23H2 64-bit)
    Posts
    83,292

    Re: Advanced sorting/matching

    That's why I have provided a workbook - open the workbook and copy the formula from there, please.

    Why is it I have to change , to ; to get formula to work?
    Because yours is a European locale.

    https://en.excel-translator.de/translator/
    Last edited by AliGW; 06-15-2024 at 03:47 AM. Reason: Additional information added.

  22. #22
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    45,081

    Re: Advanced sorting/matching

    Why is it I have to change , to ; to get formula to work?

    Regional Settings. Copy the formula from Ali's workbook. Don't reduce the 15000. If anything, make it larger to cope with future expansion.

  23. #23
    Registered User
    Join Date
    06-15-2024
    Location
    Kyrks?ter?ra, Norway
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2404 Build 16.0.17531.20190) 64-bit
    Posts
    10

    Re: Advanced sorting/matching

    IT WORKED! Thank you so much! I am so grateful for ur help!

  24. #24
    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. 2407 (Windows 11 23H2 64-bit)
    Posts
    83,292

    Re: Advanced sorting/matching

    Glad to have helped.

    If you have not already done so, remember that you can reward anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.

  25. #25
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    45,081

    Re: Advanced sorting/matching

    You're welcome.

+ 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. Advanced Sorting
    By Bigg Al in forum Excel General
    Replies: 6
    Last Post: 11-06-2018, 02:49 AM
  2. Advanced Matching Formula
    By Attrition in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-26-2013, 08:33 PM
  3. I need help on Advanced Sorting using VBA.
    By geomatics in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-01-2012, 12:18 AM
  4. (advanced) Sorting
    By Bogey in forum Excel General
    Replies: 2
    Last Post: 04-11-2012, 11:21 AM
  5. Advanced sorting help
    By sk65405 in forum Excel General
    Replies: 1
    Last Post: 06-22-2011, 10:02 AM
  6. Advanced Sorting
    By analyst1 in forum Excel General
    Replies: 6
    Last Post: 08-10-2010, 11:49 AM
  7. Advanced sorting
    By kmr296 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-15-2009, 06:54 PM
  8. Advanced Sorting
    By nandhamnk in forum Excel General
    Replies: 2
    Last Post: 11-14-2006, 03:24 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