+ Reply to Thread
Results 1 to 3 of 3

Code/Formula to sort large amounts of data

  1. #1
    Forum Contributor
    Join Date
    03-04-2014
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2019
    Posts
    756

    Code/Formula to sort large amounts of data

    Hello,

    I have done something similar in the past, where I would paste a large amount of data into a spreadsheet and then using coding and/or a formula to sort the data into a more organised way etc. However, I am unsure how to do it and what is the best way to do it?

    A sample spreadsheet is attached.

    Any help is much appreciated.

    Many thanks as always.
    Attached Files Attached Files

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Code/Formula to sort large amounts of data

    These are all array formulae. 7

    In A2, copied down:
    =IFERROR(INDEX('Paste Data'!$A:$A,SMALL(IF(LEFT('Paste Data'!$A$1:$A$21,6)="Phone:",ROW('Paste Data'!$A$1:$A$21)-2),ROWS(A$2:A2))),"")

    In B2, copied across to D2 and then down:
    =IFERROR(TRIM(MID(SUBSTITUTE(","&INDEX('Paste Data'!$A:$A,SMALL(IF(LEFT('Paste Data'!$A$1:$A$21,6)="Phone:",ROW('Paste Data'!$A$1:$A$21)-1),ROWS(B$2:B2))),",",REPT(" ",125)),125*COLUMNS($A:A),125)),"")

    In E2, copied down:
    =IFERROR(MID(INDEX('Paste Data'!$A:$A,SMALL(IF(LEFT('Paste Data'!$A$1:$A$21,6)="Phone:",ROW('Paste Data'!$A$1:$A$21)),ROWS(E$2:E2))),8,255),"")

    Array Formulae are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. After that, the array can be dragged down as normal, to cover the desired range.

    You will know the array is active when you see curly brackets { } - or "curly braces" for those of you in the USA, or "flower brackets" for those of you in India - appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Code/Formula to sort large amounts of data

    A macro alternative:

    Please Login or Register  to view this content.

+ 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. Replies: 2
    Last Post: 03-31-2017, 01:07 PM
  2. [SOLVED] HELP - This Macro works on small amounts of data but fails on large amounts
    By BookmanNLA in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-18-2015, 12:40 AM
  3. Large amounts of data
    By namluke in forum Excel General
    Replies: 3
    Last Post: 12-11-2014, 02:40 PM
  4. [SOLVED] Editing large amounts of data
    By CaitlinRose in forum Excel General
    Replies: 3
    Last Post: 02-05-2014, 02:49 PM
  5. [SOLVED] VBA code to sort data either within one large worksheet or across several worksheets
    By miss_georgina in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-08-2012, 04:52 PM
  6. [SOLVED] Rearranging large amounts of data
    By kozor in forum Excel General
    Replies: 6
    Last Post: 10-30-2012, 05:41 AM
  7. Large Amounts of Data
    By Drewser33 in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 06-17-2008, 09:13 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