Share via

Excel 365 filter formula: Return records in the column based its header's text value (eg, using match)

Brad Burton 21 Reputation points
2021-05-08T21:12:50.477+00:00

I know this is the criteria for the Filter function in Excel 365: =FILTER(array,include,[if_empty])

I want to return results based the text in a column header. I won't know the column name (for example, if I want to search for the column with the "Person" header, the column number could change (the "Person" column could be C2, or E2, or something else)

Can the "Include" criteria use Match? Something like. I'm having difficulty getting it to work:

=FILTER(A1:F100, COLUMN( MATCH( "Person"), "--")

Thank you

Microsoft 365 and Office | Excel | For business | Windows

Answer accepted by question author

  1. Lz365 38,191 Reputation points Volunteer Moderator
    2021-05-09T06:46:50.417+00:00

    Hi @Brad Burton

    FILTER the header row then FILTER the table/range:

    PIC

    in F4:
    =FILTER(Table1,
    FILTER(Table1,Table1[#Headers] = G2) = F2,
    "no match"
    )

    in F8:
    =FILTER(A3:D6;
    FILTER(A3:D6;A2:D2 = G2) = F2;
    "no match"
    )

    Was this answer helpful?


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.