Better way to find column heading value?

A

Al Biglan

I have a worksheet laid out sort of like a schedule...
Col A = Task Name
Col B = Last Date
Cols C:BB = Weeks of the year (52 of 'em)
Row 1 of Cols C:BB have the Monday Date for the week (e.g.
Jan 6,2003)

For a Task, I fill in an X for each week where work is
done on the task. I want a formula in Col B that finds
the last X in the row (the X's may not be contiguous and
if the cell isn't an X it's blank) then spits out the
corresponding date in the header.

Right now I have :
=INDIRECT(ADDRESS(1,MAX(COLUMN(C2:BB2)*(C2:BB2<>""))))
as an array formula

Is there a better way to do this? Using Indirect(Address
()) seems like I'm missing a better lookup mechanism...

Thanks
-al
 
H

Harlan Grove

... the following works equally well...

=INDEX($C$1:$BB$1,MATCH(CHAR(255),C2:BB2))
...

It would if you have no cells evaluating to strings beginning with CHAR(255).
The REPT(.) term is the guaranteed 'last' text value. CHAR(.) alone will usually
work, but REPT(.) is *guaranteed* to work.
 

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