+ Reply to Thread
Results 1 to 3 of 3

Formula to identify column heading

Hybrid View

  1. #1
    Registered User
    Join Date
    12-10-2021
    Location
    USA
    MS-Off Ver
    Microsoft 365 Apps for Enterprise
    Posts
    1

    Formula to identify column heading

    Folks at Excel Forum –

    New to the Forum here.

    I have a simple (I hope) question about how to reference a cell (column heading) in a table, using a formula that finds the minimum value within a row of cells in that same table.

    Example: The table contains four columns with column headings “First”, “Second”, “Third”, “Fourth”, and a row containing numbers; i.e., 3.3, 2.4, 0, 9.5 respectively. I am using the SMALL formula to identify the smallest number non-zero number in the row, in a cell at the end of the row:

    =SMALL(B1:B4,COUNTIF(B1:B4,0)+1)

    I’d like to enter a formula in an adjacent cell to also return the column heading (either as text or a number) of that smallest number. For the example, the smallest number is 2.4, and the corresponding column heading would be Second.

    Any suggestions?

    Thanks,

    -R

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2404
    Posts
    24,858

    Re: Formula to identify column heading

    That formula does not find the smallest non-zero number in the row. It finds the smallest non-zero number in the first four rows of column B. To find the smallest number in the row you want this, starting in row and copy down:

    Formula: copy to clipboard
    =SMALL(A$2:D$2,COUNTIF(A$2:D$2,0)+1)

    If your SMALL formula is in column E, start in row 2 with this formula and copy down to get the header:

    Formula: copy to clipboard
    INDEX($A$1:$D$1, 1, MATCH(E2, $A2:$D2, 0))
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

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

    Re: Formula to identify column heading

    Hi & welcome to the board.
    Your formula is returning the smallest non zero in a column, not a row. That said you can replace your formula with
    Formula: copy to clipboard
    =MIN(FILTER(A2:D2,A2:D2<>0))
    and then use
    Formula: copy to clipboard
    =FILTER($A$1:$D$1,A2:D2=F2)
    Where F2 is the cell with the smallest number

+ 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. Formula to calculate only if in range of column Heading
    By caabdul in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-17-2020, 02:16 AM
  2. [SOLVED] Formula for matching heading in rows to column
    By Neilesh Kumar in forum Excel General
    Replies: 1
    Last Post: 11-21-2016, 08:39 AM
  3. Replies: 1
    Last Post: 10-13-2016, 07:14 AM
  4. [SOLVED] Formula to search table and return column heading
    By majime01 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-13-2015, 01:02 PM
  5. Formula for column / heading
    By qibla in forum Excel General
    Replies: 4
    Last Post: 11-15-2009, 05:26 AM
  6. [SOLVED] Formula to Return Column Heading
    By den4673 in forum Excel General
    Replies: 4
    Last Post: 02-13-2006, 06:00 PM
  7. [SOLVED] In a table produce an value by column heading and row heading
    By naflan in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-27-2005, 01:25 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