You could use MATCH
Eg assuming the years (2008, 2007, etc) are numbers entered in B1 across
then in say, A20: =MATCH(2008,$1:$1,0)
will return the col number for 2008

Signature
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
> I have a work sheet with 6 columns the headers of the columns are A=Class
> Codes,B-F are years 2008,2007,2006etc. can i have excell put a value in a
> cell as to the column number for the years example for 2008 column 2 for 2007
> column 3 and so on.
904allen - 01 Apr 2008 18:44 GMT
Thanks Guys I got it figured out. I now have another problem I'm attempting
to do a Vlookup formula. I used this formula with a fixed cell before and it
works, I'm now attempting to use a cell that has a formula that changes the
year this is the look_up value. i can't get excel to read the value and not
the formula. this is the last thing i need to get this project running.
Thanks Allen
> You could use MATCH
> Eg assuming the years (2008, 2007, etc) are numbers entered in B1 across
[quoted text clipped - 4 lines]
> > cell as to the column number for the years example for 2008 column 2 for 2007
> > column 3 and so on.
Where does the value originate and how should Excel know where to put it?
Some more clarity needed for this responder.
Gord Dibben MS Excel MVP
>I have a work sheet with 6 columns the headers of the columns are A=Class
>Codes,B-F are years 2008,2007,2006etc. can i have excell put a value in a
>cell as to the column number for the years example for 2008 column 2 for 2007
>column 3 and so on.
904allen - 01 Apr 2008 20:27 GMT
1)=IF(C9="","",IF(DATE(YEAR(C9),12,31)>F$6,F$6,DATE(YEAR(C9),
12,31))) orignating formula My Vlookup then looks at this formula
2)=IF(D9="","",""&TEXT(D9,"yyyy")) this is my Vlookup formula
=HLOOKUP('Penalty Calculation Worksheet'!B9,A10:B14,2) B9 is the second
formula
> Where does the value originate and how should Excel know where to put it?
>
[quoted text clipped - 6 lines]
> >cell as to the column number for the years example for 2008 column 2 for 2007
> >column 3 and so on.