Thread: Function Help
View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
stacyjhaskins stacyjhaskins is offline
external usenet poster
 
Posts: 9
Default Function Help

Yes, that is what I'm trying to do. Where do I type the cell references to
allow the function to know where my dates are located? Do I need to type
something in the ROW()?

My dates are located in X29:IV29, and the students' names start in row 33.

Thank you for your help.

"Toppers" wrote:

Another solution to allow for dates outside range A1 to Z1:

=INDIRECT(LastDateColumn(ROW())) in LastDateAttended column


Function LastDateColumn(r)
Dim i as integer
i = Cells(r, Columns.Count).End(xlToLeft).Column
LastDateColumn = Cells(1, i).Address
End Function


HTH

"Toppers" wrote:

Sorry ... typo LastData should be LastDate


Function LastDate(r)
LastDate = Cells(r, Columns.Count).End(xlToLeft).Column
End Function


"Toppers" wrote:

Put this in each cell in the LastDateAttended column and add the user-defined
function below:_

=INDIRECT(CHAR(LastDate(ROW())+64) & "1")

I am assuming you find the LastDateAttended by looking for the last entry in
each student's row i.e the 1.5. 2.0 etc data, and taking the corresponding
date from row 1.

Function LastDate(r)
LastData = Cells(r, Columns.Count).End(xlToLeft).Column
End Function


HTH

"stacyjhaskins" wrote:

I would like to create a function that would return the last date a student
attended class. The spreadsheet is setup like below:

Dates *LastDateAttended 7/1 7/2 7/3
-----------------------------------------------------------------------
Student1 No Show
Student2 7/3 1.5 2.5 2
Student3 7/2 2.5

Any suggestions?