How to reference a column heading in a cell automatically?

K

KenV

It's difficult to explain my question, but I'll try.

Example:

I have a spreadsheet with column headings of names of people and rows with
names of each of the 12 months for a particular year.

In each cell is the number of sales made by each person each month.

At the end of each "month" row I have a cell in which I calulate by formula,
for example, =MAX(B18:M18), the maximum number of sales for that month by a
particular person, say, John. IOW, it is a cell that gives the maximum
number of sales made by any one person that month. No problem there. But
either in that cell, or in another cell next to it, I want to automatically
place the /name/ of the person in the column heading who made the maximum
number of sales for that month. How do I do that? It probably is simple, but
I don't know the answer.

Thanks very much.

Ken
 
K

KenV

Don Guillett said:
Have a look in the help index for MATCH and then INDEX

I looked but couldn't figure out how to apply what I found. I found some
other help on using names in formulas, but not how to make a column name
appear in a cell as the result of a formula, as in the example I gave. That
is, if the cell gives the maximum sales in a month of any person as 9, and
those 9 sales were made by the person, John, in the column headed by "John",
how do I make the cell next to the number 9 say "John"?

Ken
 
T

T. Valko

............A..........B...........C
1........Bill.......Sue.......John
2........50........59..........66

=INDEX(A1:C1,MATCH(MAX(A2:C2),A2:C2,0))

The only complication is if more than 1 person has the highest number of
sales.

Biff
 
K

KenV

Yes! It worked perfectly in my SS. Thank you!!

Now I understand the index function somewhat and will try to use it in other
places as well.

Ken
 
T

T. Valko

You're welcome. Thanks for the feedback!

Biff

KenV said:
Yes! It worked perfectly in my SS. Thank you!!

Now I understand the index function somewhat and will try to use it in
other places as well.

Ken
 

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