+ Reply to Thread
Results 1 to 4 of 4

Return the header of the table based on the data in array

  1. #1
    Registered User
    Join Date
    12-22-2017
    Location
    Detroit, MI
    MS-Off Ver
    2016
    Posts
    19

    Return the header of the table based on the data in array

    Hello,

    I have a huge true/false array with thousands of rows and 23 columns. Each row should only have one column displaying "True" and rest of the columns would be "false". I would like to add a column to detect if there's more than one "True" in that given row. If there's only one "True" in that row, I would like to add a second column to display the header of the column that has the "True".

    I'm very bad at explaining this, but please look at the attached Excel sheet to get a better understanding. Thank you for your help in advance.
    Attached Files Attached Files
    Last edited by ronakpatel; 10-27-2019 at 06:22 PM. Reason: solved

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,647

    Re: Return the header of the table based on the data in array

    None of the rows contain more than one TRUE, so there are no errors to find ...

    In L2 copied down:

    =IF(COUNTIF(A2:K2,TRUE)>1,"Yes","")

    In M2 copied down:

    =INDEX($A$1:$K$1,MATCH(TRUE,A2:K2,0))
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,075

    Re: Return the header of the table based on the data in array

    Forget this, just realised Switch is not available in 2016

  4. #4
    Registered User
    Join Date
    12-22-2017
    Location
    Detroit, MI
    MS-Off Ver
    2016
    Posts
    19

    Re: Return the header of the table based on the data in array

    Thank you AliGW!!

+ 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 nearest value above in table. return header row + header column
    By 323428 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-22-2018, 05:06 AM
  2. [SOLVED] How to return column header based on a value from a table
    By elf607 in forum Excel General
    Replies: 12
    Last Post: 09-30-2016, 08:43 AM
  3. Replies: 6
    Last Post: 09-27-2016, 07:36 AM
  4. [SOLVED] Lookup based on Two Criteria to return header data
    By jsclark in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-06-2014, 01:27 PM
  5. [SOLVED] Find specific value in table and return header row and header column value
    By nelwan in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-30-2013, 01:35 AM
  6. Replies: 4
    Last Post: 07-15-2012, 02:13 PM
  7. Find data in table but return HEADER
    By Greymalkin in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-05-2008, 01:32 PM

Tags for this Thread

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