ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Index heading when cell is populated (https://www.excelbanter.com/excel-worksheet-functions/108937-index-heading-when-cell-populated.html)

Kevin M

Index heading when cell is populated
 
Hi all TIA, I must be having a lapse this morning...

I have an array of headings with either a "P" (primary) or "B" (Backup) that
fall under eight headings. Each row usually has a P and B in two cells. What
I'd like to report in another cell is when P is in a column I would like to
report that column heading. Same formula for the cell that will be reporting
B. I thought about an IF w/ nested IFs for each heading but that seems too
messy.

Cheers,

Kevin M.

Bob Phillips

Index heading when cell is populated
 
=INDEX(A1:H1,MATCH("P",A2:H2,0))

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Kevin M" wrote in message
...
Hi all TIA, I must be having a lapse this morning...

I have an array of headings with either a "P" (primary) or "B" (Backup)

that
fall under eight headings. Each row usually has a P and B in two cells.

What
I'd like to report in another cell is when P is in a column I would like

to
report that column heading. Same formula for the cell that will be

reporting
B. I thought about an IF w/ nested IFs for each heading but that seems too
messy.

Cheers,

Kevin M.




Kevin M

Index heading when cell is populated
 
Beauty, thanks Bob.

Kevin M.

"Bob Phillips" wrote:

=INDEX(A1:H1,MATCH("P",A2:H2,0))

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Kevin M" wrote in message
...
Hi all TIA, I must be having a lapse this morning...

I have an array of headings with either a "P" (primary) or "B" (Backup)

that
fall under eight headings. Each row usually has a P and B in two cells.

What
I'd like to report in another cell is when P is in a column I would like

to
report that column heading. Same formula for the cell that will be

reporting
B. I thought about an IF w/ nested IFs for each heading but that seems too
messy.

Cheers,

Kevin M.






All times are GMT +1. The time now is 09:57 PM.

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