Discussion Locked

Excel Formula help!!!!

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I am trying to make a class attendance register. I am trying to add ranges.
If I put a one (1) in each cell... no problem. BUT, i have to enter "Excused", Late, and Truant. I thought maybe that I might enter E, L or T and use an IF statement to change the text to a number. Is this possible and if so what formulae would I need to do each of these.
Thank you for any help
Merv
mervt@arctic.ca

4 replies

by larry h.

Type your code (A for attended, E, L, or T as you mentioned above). Then create formulas to count each of the four codes.

If you used cells D1:D20 to enter the codes the formula to count the number of "A"s would be:
=COUNTIF(D1:D20,"A")

by whatme?

Thank you very much. I tries several configs close to that but it was staring me right in the face. It helps a lot
Merv

by oliver w.

Use VBA and create a function like this

Public Function Attendance (Value as String) As Integer
'Now we have to differentiate the ELT
Select Case Value
Case E
Attendance = 1
Case L
Attendance = 2
Case T
Attendance = 3
Case Else
Attendance = -1
End Select
End Function

Now you can put this in a regular Cell and use it like any other Formula (e.g in A2: "=Attendance(A3)" will return 1,2,3 or -1 in any other case.

Hope that helps
Oliver

This discussion is closed to new replies.