+ Reply to Thread
Results 1 to 8 of 8

Reduce Several Columns of Data to Two Columns

  1. #1
    Registered User
    Join Date
    11-06-2010
    Location
    Vegas
    MS-Off Ver
    Excel 2017
    Posts
    51

    Reduce Several Columns of Data to Two Columns

    Thank you for considering my problem. I am fairly new to Excel and have been unable to solve it. I have attached a spreadsheet to illustrate it.

    The initial data will consist of 18 columns of data, with numbered headings, beside various names in the left hand column. There can be any number of rows. Some of the columns will have a "1" in them, but those columns will have only one "1."

    From that data, I would like to summarize it with two columns: One column with the headings of those columns with a "1" and one column with the corresponding name. The headings of columns without a "1" will not appear.

    It's difficult to describe the problem clearly, so hopefully the attached example will make it clear. Is there a macro or possibly formulas or array formulas that can accomplish this?

    Any thoughts would be greatly appreciated. Thank you.
    Attached Files Attached Files

  2. #2
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Reduce Several Columns of Data to Two Columns

    Here's one way:

    U2 =IFERROR(INDEX($2:$2,SMALL(IF(B$3:S$10=1,COLUMN(B$3:S$10)),ROWS($1:1))),"") Ctrl Shift Enter

    V2 =INDEX(A:A,MIN(IF((B$2:S$2=U2)*(B$3:S$10=1),ROW(B$3:S$10))))&"" Ctrl Shift Enter

  3. #3
    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: Reduce Several Columns of Data to Two Columns

    Before answering the specific question which is of course doable in the way you show, but if you are able to capture the data in a different layout then it becomes much easier.

    So the Q. is are you able to capture the data differently. i.e. could you have a table with columns for

    Name
    Column Name

    Where the column name column could be drop down cells that contain a list of all column names form which you pick one.

    So your data would look like Sheet 2 in the attached and the analysis by Pivot Table which would be far more efficient and doesn't need functions or macros.
    Attached Files Attached Files
    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.

  4. #4
    Registered User
    Join Date
    11-06-2010
    Location
    Vegas
    MS-Off Ver
    Excel 2017
    Posts
    51

    Re: Reduce Several Columns of Data to Two Columns

    Thank you! Both answers work beautifully. I will have to study the pivot table approach.

  5. #5
    Registered User
    Join Date
    11-06-2010
    Location
    Vegas
    MS-Off Ver
    Excel 2017
    Posts
    51

    Re: Reduce Several Columns of Data to Two Columns

    I have an additional question. Rather than finding the rows equal to "1", is it possible to find the rows that equal the value in the top row? I have tried to change the array formula you posted but can't get it to work. I am attaching another file to illustrate. Thank you again.
    Attached Files Attached Files

  6. #6
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Reduce Several Columns of Data to Two Columns

    Try these:

    U2 =IFERROR(INDEX($2:$2,SMALL(IF(B$3:S$10=B$1:S$1,COLUMN(B$3:S$10)),ROWS($1:1))),"") Ctrl Shift Enter

    V2 =INDEX(A:A,MIN(IF((B$2:S$2=U2)*(B$3:S$10=B$1:S$1),ROW(B$3:S$10))))&"" Ctrl Shift Enter

  7. #7
    Registered User
    Join Date
    11-06-2010
    Location
    Vegas
    MS-Off Ver
    Excel 2017
    Posts
    51

    Re: Reduce Several Columns of Data to Two Columns

    Perfect! Thanks again.

  8. #8
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Reduce Several Columns of Data to Two Columns

    Happy to help. Thanks for the rep!

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

+ 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. Comparing columns but need to Reduce Time of response.
    By Eoam13 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-05-2014, 05:22 AM
  2. Replies: 12
    Last Post: 01-30-2014, 01:33 AM
  3. Duplicate rows, delete columns w/same data, combine columns w/unique data, Mac Excel 2011
    By msmcoin in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 2
    Last Post: 02-03-2013, 02:10 PM
  4. How to reduce number of columns in worksheet?
    By frozenEX.com in forum Excel General
    Replies: 2
    Last Post: 04-20-2010, 12:29 PM
  5. Reduce number of rows and columns
    By rajeshnair in forum Excel General
    Replies: 5
    Last Post: 12-07-2008, 03:30 PM
  6. How do I reduce the no. of rows & columns in a worksheet ?
    By Anna Walton in forum Excel General
    Replies: 2
    Last Post: 05-30-2006, 12:25 PM
  7. [SOLVED] Reduce columns and rows count?
    By murat in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-16-2005, 04:06 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