View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Toppers Toppers is offline
external usenet poster
 
Posts: 4,339
Default lookup column label based on data in cell

Try this in cell in row 2 of your filtered data and copy down (say F2):

=INDEX($A$1:$D$1,0,MATCH(1,$A2:$D2,0))

will return column heading from row 1

Is this what you require?

"Aaron" wrote:

Hello

I have a table that looks something like this:
A B C D
1 0 0 0 1
2 0 0 0 0
3 0 1 0 0
4 0 1 1 0
5 0 0 0 0
6 1 0 0 0

On a separate sheet, I have the list sorted to exclude rows without a "1" in
any column. What I'd like to do, for the columns that do have a 1, is return
the column label. The column labels are reasons for events, so the result
would be for "Event" 1, "Reason" D. It doesn't matter if there's more than
one 1 in a column, only one of the reasons needs to be returned. I'd rather
not use a macro to do this, does anyone know of a way with just functions?

Thanks