+ Reply to Thread
Results 1 to 13 of 13

Faster way than deleting columns one by one to reduce my data to the correct columns

  1. #1
    Registered User
    Join Date
    12-04-2013
    Location
    Kansas City
    MS-Off Ver
    Excel 2010
    Posts
    7

    Faster way than deleting columns one by one to reduce my data to the correct columns

    Hello,

    Every week I take a large spreadsheet (~90 columns) and break that into smaller spreadsheets (~15 columns) manually. The smaller spreadsheets are subsets of the larger sheet but columns are in a specific order and sometimes not like the sequence of the large sheet. I typically just go in and manually copy all the columns into a new spreadsheet with all the accompanying row data, then delete the columns I don't need. But this takes forever!

    Is there a way to pull only the required columns and data into my reoccurring smaller sheets?

    For example:
    The large spreadsheet has columns:
    ABCDEFG

    The smaller sheet has columns in this order:
    ACF
    or even
    FBG

    I created templates for each smaller reoccurring spreadsheet (just with the columns and no data) so I know which columns to bring over. I tried using a VLOOKUP formula but I have to know the col_index_num and that changes for each smaller sheet.

    I am sure many of you have been in this same instance whereby you want to pare down a huge file into a smaller one but manually deleting or copy/pasting only those columns is tedious.

    Many thanks!

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

    Re: Faster way than deleting columns one by one to reduce my data to the correct columns

    Do you have headers in the main sheet and the subsidiary sheets? If so, you could put this formula in A2 of each subsidiary sheet:

    =INDEX('Main sheet'!$A:$AD,ROW(),MATCH(A$1,'Main sheet'!$1:$1,0))

    then you can copy this across as far as you need for each sheet, and then copy the formulae on row 2 down as far as you need (until you get blanks or zeros).

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    12-04-2013
    Location
    Kansas City
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Faster way than deleting columns one by one to reduce my data to the correct columns

    Pete,

    I've tried that in the attached file but no luck. Can you help me understand the issue and input the correct formula in the ORDER NUMBER (A2) field?

    test.xlsx

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

    Re: Faster way than deleting columns one by one to reduce my data to the correct columns

    You didn't copy the formula directly - this is the formula that you should have in A2 of the Small sheet:

    =INDEX(Large!$A$1:$H$999,ROW(),MATCH(A$1,Large!$1:$1,0))

    then you can copy this across and down as required. Excel will return an empty cell as a zero when using formulae like this - if you want to avoid that happening then you can use this formula in A2 instead:

    =IF(INDEX(Large!$A$1:$H$999,ROW(),MATCH(A$1,Large!$1:$1,0))="","",INDEX(Large!$A$1:$H$999,ROW(),MATCH(A$1,Large!$1:$1,0)))

    then copy that across or down.

    Hope this helps.

    Pete

  5. #5
    Registered User
    Join Date
    12-04-2013
    Location
    Kansas City
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Faster way than deleting columns one by one to reduce my data to the correct columns

    AMAZING! Thanks Paul. I have never used the INDEX function nor do I understand the ROW() instead of using a value. But I will read more about this, because this is very helpful.

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

    Re: Faster way than deleting columns one by one to reduce my data to the correct columns

    I'm Pete, not Paul, but thanks for feeding back.

    If that takes care of your original question, please select Thread Tools from the menu above your first post and mark this thread as SOLVED.

    Also, since you are relatively new to the forum, I would like to inform you that you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    Pete

  7. #7
    Registered User
    Join Date
    12-04-2013
    Location
    Kansas City
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Faster way than deleting columns one by one to reduce my data to the correct columns

    Pete,

    Thanks for your help but I have a small problem. The issue is similar but I can't get the formula to work in a similar instance. I guess I don't truly understand the syntax/application of the formula.

    I am using a Google Form Doc now to take in some information, unfortunately Google Forms likes to keep the columns in the EXACT order I created the form in so all these responses (new data) are in different column orders that I would need to analyze the data (in the Master). So the issue is I have new incoming data (daily) and would like to put it all in order into the Master file I created. Instead of manually moving all the columns each day around to get the right order of the data I just want to use a similar formula.

    Master:
    Column names: Timestamp, Name, Email...etc.

    New Data output from Google:
    Column names: Time, Email, Name...etc.

    I have attached a copy of the issue with each tab putting in just a sample of the header names. Cheers
    Attached Files Attached Files

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

    Re: Faster way than deleting columns one by one to reduce my data to the correct columns

    Here's a simpler approach - put these formulae in the cells stated in the Master sheet:

    A2: ='New Data'!A2
    B2: ='New Data'!B2
    C2: ='New Data'!E2
    E2: ='New Data'!C2

    Not sure where you would get the phone number from (D2).

    Then copy down until you get zeros.

    Hope this helps.

    Pete
    Last edited by Pete_UK; 01-22-2014 at 05:32 AM.

  9. #9
    Registered User
    Join Date
    12-04-2013
    Location
    Kansas City
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Faster way than deleting columns one by one to reduce my data to the correct columns

    Pete

    This would work ok if I only had like 3 or 4 columns but I have many dozens to sort through and pick the right cells to input that formula. Also the Master list columns are in very different order than the NEW DATA so it makes it very difficult to try and match these up initially. I just put those columns in as an example, but there are lots more. Since the headings of the columns are the same in the MASTER list vs. the New Data (just in different order) can I use an =INDEX() similar to before?

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

    Re: Faster way than deleting columns one by one to reduce my data to the correct columns

    I can only go off the file(s) that you attach - they should be representative of your real files, even if the data is made up. Post another example with data in it, then I might understand your problem better.

    Pete

  11. #11
    Registered User
    Join Date
    12-04-2013
    Location
    Kansas City
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Faster way than deleting columns one by one to reduce my data to the correct columns

    Pete,

    Thanks for your help; here is a new document with more fields (only a sample) but more to work with

    Justin
    Master2-New Example.xlsx

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

    Re: Faster way than deleting columns one by one to reduce my data to the correct columns

    Put this formula in cell A5 of the Master sheet:

    =IFERROR(INDEX('New Data'!$A$1:$O$999,ROWS($1:2),MATCH(A$1,'New Data'!$1:$1,0)),"")

    then copy across to M5. Then copy that row of formulae down until you start to get rows of zeros. Note that the headings have to be the same in both sheets - you get blanks in column L as the heading is different.

    Hope this helps.

    Pete

  13. #13
    Registered User
    Join Date
    12-04-2013
    Location
    Kansas City
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Faster way than deleting columns one by one to reduce my data to the correct columns

    WOW you did it again Pete!

+ 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. Bring scattered data to correct columns
    By vadaniels in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 12-22-2020, 10:32 PM
  2. [SOLVED] Faster way to copy and paste multiple columns in Sheet1 to corresponding columns in Sheet2
    By babbeleme1 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-19-2013, 12:55 AM
  3. Replies: 3
    Last Post: 12-19-2012, 08:46 PM
  4. Reduce the big file deleting unncessary data
    By jdbaba in forum Excel General
    Replies: 0
    Last Post: 02-02-2012, 09:25 PM
  5. Paste csv data into an xls sheet in the correct columns
    By bananas in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-07-2007, 02:22 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