View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.misc
JLatham JLatham is offline
external usenet poster
 
Posts: 3,365
Default find column letter

In that case, Pete_UK has a good solution (the others are also good, I just
read his a little more because he made same assumption I almost did at first)
- but change the B1:AH1 in his formula to B1:Z1 to be more exact.

Actually his B1:AH1 would probably still work, since you're going to
encounter the date (or not) by the time you get to Z anyhow and it'll never
have to look beyond Z in that case.

"Stuart WJG" wrote:

Hi there
the dates are in the range sya b1 to z1.
say the date of 01/08/08 is in B1 in the range.
I need to able to enter a date say in A2
and then put a formula in A1 that looks at the date in A2 say 01/08/08 and
returns the column later in this case as B in say a3

"JLatham" wrote:

Well, here's part of an answer. This formula will return the column
identifier based on a column number. In the example, the column number is
assumed to be in cell E4:
=IF(E426,CHAR(CEILING(E4/26,1)+63),"")&CHAR(IF(MOD(E4,26)=0,26,MOD(E4,26))+ 64)

The original source for that, I believe, is John Walkenbach. It handles
anything up to column number 702 (ZZ) which was fine for Excel 2003 and
earlier versions.

To give a more complete solution, I need to know more about where your dates
are at in that range of B1:AH6 - are they in a particular column (in which
case you'd already have the answer) or on a particular row, or is the entire
matrix filled with dates?



"Stuart WJG" wrote:

I need a formula that can look for a date in
a cell that matchs a date in a range and then enter column letter in the
formula cell
Formula in A1
Variable cell (date) A2
Range B1:ah6