Return the value of a column heading

E

Eric

Here's my data...
A B C D E F G H
1 Name First Last Jan Feb Mar Apr May
2 John ____ ____ 5 10 5
3 Jim ____ ____ 3 6 5

How do I get B2 to return "Feb" and C2 to return "Apr"; B3 to return "Jan"
and C3 to return "Mar"?

Hopefully the spacing won't lose anything when posted. Thanks!
 
T

T. Valko

Try these:

B2:

=IF(COUNT(D2:H2),INDEX(D$1:H$1,MATCH(TRUE,INDEX(D2:H2<>"",0),0)),"")

C2:

=IF(COUNT(D2:H2),LOOKUP(1E100,D2:H2,D$1:H$1),"")

Select both B2 and C2 then copy down as needed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top