ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How to reference a column heading in a cell automatically? (https://www.excelbanter.com/excel-worksheet-functions/122613-how-reference-column-heading-cell-automatically.html)

KenV

How to reference a column heading in a cell automatically?
 
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


Don Guillett

How to reference a column heading in a cell automatically?
 

Have a look in the help index for MATCH and then INDEX

--
Don Guillett
SalesAid Software

"KenV" wrote in message
...
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




KenV

How to reference a column heading in a cell automatically?
 

"Don Guillett" wrote in message
...

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. Valko

How to reference a column heading in a cell automatically?
 
............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

"KenV" wrote in message
...

"Don Guillett" wrote in message
...

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




KenV

How to reference a column heading in a cell automatically?
 
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. Valko" wrote in message
...
...........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

"KenV" wrote in message
...

"Don Guillett" wrote in message
...

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. Valko

How to reference a column heading in a cell automatically?
 
You're welcome. Thanks for the feedback!

Biff

"KenV" wrote in message
...
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. Valko" wrote in message
...
...........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

"KenV" wrote in message
...

"Don Guillett" wrote in message
...

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








All times are GMT +1. The time now is 12:12 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com