+ Reply to Thread
Results 1 to 7 of 7

Help Sorting Data From One Tab To Another

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    10-05-2010
    Location
    CA
    MS-Off Ver
    Excel 365
    Posts
    539

    Question Help Sorting Data From One Tab To Another

    Hello,
    I’m in the process of creating a multilayered spreadsheet that sorts and organizes data but I lack the ability to make it a reality. I’m seeking help with creating the formulas to make the worksheet work the way I intend it to. I’m breaking down what I need into three phases to make it easier to understand how the it’s supposed to work. Below is a question pertaining to the first phase.

    Phase 1
    The first phase of the worksheet is to transfer a portion of data from one tab to another. The worksheet consists of two tabs, Original and Sort. I want to import a certain portion of data from the Original tab to the Sort tab.

    As in the example below:
    You can see two tabs in the same worksheet and as stated I only want a portion of the data from the Original tab to be imported into the Sort tab. That portion being the point on the Original tab labeled “START” to “FINISH”. All of column “D” to column “O” with the one caveat being that only the rows from Column “D” that have the “TRUE” value in them are to be transferred. As you can see in the example of the Sort tab the point from Colum “D” to column “O” are the only portion showing along with only the “TRUE” value rows taken from column “D”. I would like to be able to achieve this result using formulas only and not using VBA. The red portion is reserved for additional calculations that I plan on working on after the first portion is completed.

    I envision a formula that checks if the value is TRUE is column "D" of the Original Tab and if not it looks for the next TRUE value and displays what that value is in the current cell. For example, "D4" and "D5" in the Original tab are FALSE but "D6" is TRUE so the formula would display the result for the pertaining cell which would be "D4" to "O4" being the result on the Sort tab. This would continue from row to row until for all rows on the Original tab. A formula that could be dropped and dragged for any number of cells would work best but I'm open to any suggestions to make this work most effectively.

    Original Tab
    1.jpg

    Sort Tab
    2A.jpg

    Final note: Please see the attached spreadsheet for more information and a deeper breakdown of what I am trying to accomplish with a couple of Sort tab examples of how the data should be decided calculated based upon the Original tab. Also the actually spreadsheet contains much more data and factors. So I need a solution that can calculate the formulations quickly. Everything in the attached spreadsheet is calculated and entered by hand so it may contain errors. Hopefully my breakdown of what I require is sufficient explanation. Also, ignore the areas above and next to the sorted data on the Sort tab, it's for the other two phases.

    Thank you for any and all help you can provide it would be greatly appreciated. Please feel free to ask any and all questions.
    Attached Files Attached Files
    Last edited by artiststevens; 12-22-2016 at 02:40 AM.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Help Sorting Data From One Tab To Another

    Hi,

    In mandating no VBA you are seriously restricting yourself and complicating the whole process.
    You could achieve all you want with a single line of VBA code which uses an Advanced Filter to extract your data.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: Help Sorting Data From One Tab To Another

    You can try this formula. Copy it in cell A9 of your Sort sheet and and its editing with CTRL+SHIFT+ENTER keys (because this is an array formula) and copy it down and across.
    =IFERROR(INDEX('Original Sample - Phase 1'!D$4:D$14,SMALL(IF('Original Sample - Phase 1'!$D$4:$D$14=TRUE,ROW('Original Sample - Phase 1'!$D$4:$D$14)-ROW(INDEX('Original Sample - Phase 1'!$D$4:$D$14,1,1))+1),ROW(A1))),"")
    Note that this is an array formula and that if you have to copy it in a lot of cells, it will take some time calculating and it may make Excel to be slow.

    As Richard stated, VBA would be the way to go. But this formula will give the results you wanted.
    Pierre Leclerc
    _______________________________________________________

    If you like the help you got,
    Click on the STAR "Add reputation" icon at the bottom.

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,873

    Re: Help Sorting Data From One Tab To Another

    Given the size of your Full data sheets, I would suggest using a helper column in the "Original" sheet. I've used column Q in the Sample sheet with this formula in Q4:

    =IF(INDEX($A$1:$O$14,ROWS($1:4),MATCH("Start",$2:$2,0)),MAX(Q$3:Q3)+1,"-")

    This can be copied down to the bottom of your data, and will identify those records which have TRUE in the column identified with "START" by allocating a unique sequential number to them.

    Then in the Sample Sort sheet I have inserted a new column A to also act as a helper, and left your example data there for comparison, so I have this formula in cell B16:

    =IF(COLUMNS($B:B)>MATCH("Finish",'Original Sample - Phase 1'!$2:$2,0)-MATCH("Start",'Original Sample - Phase 1'!$2:$2,0)+1,"",INDEX('Original Sample - Phase 1'!$3:$3,MATCH("start",'Original Sample - Phase 1'!$2:$2,0)+COLUMNS($B:B)-1))

    This can be copied across as far as you like (I've copied to column O in the attached example file) and this will list the headings between and including the columns marked START and FINISH on the Original sheet. I've used this formula in cell A17:

    =IF(ROWS($1:1)>MAX('Original Sample - Phase 1'!$Q:$Q),"",MATCH(ROWS($1:1),'Original Sample - Phase 1'!$Q:$Q,0))

    which finds the row in the Original sheet where the matching records were found.

    This formula in B17 can be used to extract the appropriate data for the matching records:

    =IF($A17="","",IF(COLUMNS($B:B)>MATCH("Finish",'Original Sample - Phase 1'!$2:$2,0)-MATCH("Start",'Original Sample - Phase 1'!$2:$2,0)+1,"",INDEX('Original Sample - Phase 1'!$A$1:$O$14,$A17,MATCH("start",'Original Sample - Phase 1'!$A$2:$Q$2,0)+COLUMNS($B:B)-1)))

    This can be copied across as far as you like (to column O in the attached file), and then you can apply the Format Painter from one of the rows above to get dates and times etc. in the same format. You will not be able to bring across any colour coding which has been manually applied in the other sheet using a formula. The row of formulae on row 17 can be copied down as far as you need them (to row 25 in the attached file).

    Hopefully, if you follow this approach you will be able to apply it to your Full files - let me know how you get on (it might be a bit sluggish in such large sheets).

    Hope this helps.

    Pete
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    10-05-2010
    Location
    CA
    MS-Off Ver
    Excel 365
    Posts
    539

    Re: Help Sorting Data From One Tab To Another

    I wanted to start by saying thank you for all of the input and help with solving this problem. Both Richard and Pierre are correct about using VBA and I am aware of the virtues of it and how it has been much easier to accomplish my desired result but I lack the skills to make changes if needed. Thank you all very much for help, especially Pete, the formulas you created worked exactly how I needed them to and even with the larger data set the calculating speed wasn't sluggish. The assistance with this is greatly appreciated.

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,873

    Re: Help Sorting Data From One Tab To Another

    Glad to help - thanks for the rep.

    Pete

  7. #7
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Help Sorting Data From One Tab To Another

    Quote Originally Posted by artiststevens View Post
    I wanted to start by saying thank you for all of the input and help with solving this problem. Both Richard and Pierre are correct about using VBA and I am aware of the virtues of it and how it has been much easier to accomplish my desired result but I lack the skills to make changes if needed. Thank you all very much for help, especially Pete, the formulas you created worked exactly how I needed them to and even with the larger data set the calculating speed wasn't sluggish. The assistance with this is greatly appreciated.
    Hi,

    I understand your reluctance to get to grips with VBA, we've all been there. Nevertheless I'd urge you to give it a chance.
    As I said a single line of code like

    Range("your_data").AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range("your_output_range"), CriteriaRange:=Range("your_criteria_range")
    will do the job.

    In plain English this simply says "take my 'your_data range' and copy it to my 'your_output_range' using the range called 'your_criteria_range' to filter only the rows which meet the selection criteria.

    will almost certainly do the job. And if you make the name 'your_data' a dynamic range name you needn't worry about having to change the range as new data is added so you will avoid any need to change the code at all.

+ 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: 1
    Last Post: 12-16-2015, 01:04 PM
  2. Replies: 0
    Last Post: 02-24-2014, 11:27 AM
  3. Macro-need help sorting data to other worksheets/update as new data is entered.
    By Beefy1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-31-2014, 12:09 PM
  4. [SOLVED] Data Analysis: Comparing 3 columns, sorting, removing unique values, display data
    By kmills2626 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-14-2013, 07:27 AM
  5. Sorting 2 data ranges by comparing one column in each and sorting to match
    By MDKsmiffy in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-17-2013, 03:30 PM
  6. Replies: 3
    Last Post: 12-20-2012, 06:16 AM
  7. Sorting, finding dulicates, moving one data element up, deleting original data
    By rickwtx in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 01-13-2011, 07:32 PM

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