+ Reply to Thread
Results 1 to 9 of 9

Making a list of the row title under the corresponding column title in if a cell has X

  1. #1
    Registered User
    Join Date
    02-06-2019
    Location
    Charleston, SC
    MS-Off Ver
    MS Office 2016
    Posts
    4

    Making a list of the row title under the corresponding column title in if a cell has X

    Sorry for the confusing title, I couldn't think of a concise way to summarize what I want to do. I want to have an input table with the column titles being the title of something and the row names as the names of people. The idea is, when the cell contains something, probably an X, a separate table with the same column titles will populate a list of the names X'ed in the corresponding column. Below I have attempted to make some tables with what I imagine it looking like.

    Input table where cells are X'ed as needed.
    1000.1A 2000.2B 3000.3C
    Smith X
    Jones X X
    Williams X X X


    Output table where the list is generated based on the X's
    1000.1A 2000.2B 3000.3C
    Williams Jones Jones
    Williams Smith
    Williams


    I am able to get the names as an output to the correct column, but I do not know how to move them up to the top-most open space. Right now I am using =IF(B2<>"",A1,"") to get the name in the appropriate list. But as you can see, it will leave an empty space for that row under the output column. This is where I get stuck trying to squish it up to the top.

    Also, as a separate note, I would like to sort them by alphabetical order when they are in that column.

    Any help is much appreciated.
    Last edited by Poss273; 02-06-2019 at 12:51 PM. Reason: Clarifying to show that column titles are not to be confused with the standard titles shown in Excel

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Making a list of the row title under the corresponding column title in if a cell has X

    With data on Sheet1
    Create a Sheet2

    in Sheet2!A1
    =IFERROR(INDEX(Sheet1!$A1:$A3,AGGREGATE(15,6,ROW($A1:$A3)/((Sheet1!$B$1:$B$3="X")),ROWS(A$1:A1))-(1-1),1),"")

    in Sheet2!B1
    =IFERROR(INDEX(Sheet1!$B1:$B3,AGGREGATE(15,6,ROW($A1:$A3)/((Sheet1!$C$1:$C$3="X")),ROWS(A$1:A1))-(1-1),1),"")

    in Sheet2!C1
    =IFERROR(INDEX(Sheet1!$C1:$C3,AGGREGATE(15,6,ROW($A1:$A3)/((Sheet1!$D$1:$D$3="X")),ROWS(A$1:A1))-(1-1),1),"")

    copy down as far as row 3
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Registered User
    Join Date
    02-06-2019
    Location
    Charleston, SC
    MS-Off Ver
    MS Office 2016
    Posts
    4

    Re: Making a list of the row title under the corresponding column title in if a cell has X

    Thank you for your response, however I have not been able to make this work when I try. I have edited the post above to clarify the column titles. I was using "A, B, C" as placeholders. They were not meant to be confused with the standard column names provided by Excel. So all of column A will be used to input the names and all of row 1 will be used to name column titles corresponding to an instruction code. The X's will only be placed in cells from B2 down and to the right.

    I have tried to look through the formula you provided and understand each function and what is going on but I am unable to understand most of it individually. A apologize that I cannot follow along with this because of my lack of experience using Excel in this manner.

    Also, is this infinitely expandable?

  4. #4
    Registered User
    Join Date
    02-06-2019
    Location
    Charleston, SC
    MS-Off Ver
    MS Office 2016
    Posts
    4

    Re: Making a list of the row title under the corresponding column title in if a cell has X

    Here is an excel file so see what exactly I have, which is next to nothing.
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Making a list of the row title under the corresponding column title in if a cell has X

    Post a sample spreadsheet with expected results, remove any sensitive data, create a mockup example if necessary.
    Use the Go Advanced option at the bottom of the page then scroll down to Manage Attachments as the "paperclip" method does not work on this forum.

    UPDATE: Oh you have! :-)

  6. #6
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Making a list of the row title under the corresponding column title in if a cell has X

    in Sheet2!A2
    =IFERROR(INDEX(Sheet1!$A$2:$A$4,AGGREGATE(15,6,ROW($A2:$A4)/((Sheet1!B$2:B$4="X")),ROWS(A$1:A1))-(2-1),1),"")
    copy across and down to C4

    The general format of the formula

    '=IFERROR(INDEX(range,AGGREGATE(15,6,ROW(range)/(range to check and condition),ROWS(first cell reference with anchored row - first row))-(first row-1),column),"")

  7. #7
    Registered User
    Join Date
    02-06-2019
    Location
    Charleston, SC
    MS-Off Ver
    MS Office 2016
    Posts
    4

    Re: Making a list of the row title under the corresponding column title in if a cell has X

    Alright, progress, but it seems row 4 is not working. Here it is copied from A2 to C4.
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Making a list of the row title under the corresponding column title in if a cell has X

    Aah, my formula works but only if the data starts on row 1.
    I'll have a look at changing it for other rows.

    UPDATE: Ah, left out my $ signs.
    This looks better

    =IFERROR(INDEX(Sheet1!$A$2:$A$4,AGGREGATE(15,6,ROW($A$2:$A$4)/((Sheet1!B$2:B$4="X")),ROWS(A$1:A1))-(2-1),1),"")
    copy across and down to C4
    Last edited by Special-K; 02-07-2019 at 06:02 AM.

  9. #9
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: Making a list of the row title under the corresponding column title in if a cell has X

    Try

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


    copy across
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark 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. [SOLVED] Search a sheet for a song title and return Album title
    By A440 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-28-2016, 10:19 AM
  2. [SOLVED] Help making a chart title from cell contents.
    By maurerma in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 01-10-2014, 04:06 PM
  3. Replies: 4
    Last Post: 10-19-2012, 12:09 PM
  4. Replies: 12
    Last Post: 08-10-2012, 05:11 PM
  5. Replies: 2
    Last Post: 07-05-2007, 11:07 AM
  6. Replies: 2
    Last Post: 07-21-2006, 05:10 AM
  7. Pasting Objects into Chart title and Axis title
    By Sam in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 06-06-2005, 04:05 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