Question regarding functions

C

CasperGemini

Hello. I have a (hopefully) basic question on how to create a specific
function in Excel. Here is a rundown of the spreadsheet I'm working with:
It's a quality score tracker, so in column A there is a list of names.
Column B is where I want the function to go. Columns C through R contain the
data. Row 1 is all of the dates in November. In the cells that cross
between the names and the dates, they are either blank (meaning no quality
scores were entered for that employee for that date) or they contain a number
between 0 and 5. What I want column B to do is tell me when there are 3
consecutive numbers that are greater than three. They can have blanks
between them, but nothing at 2.75 or lower. My questions: 1) Is this
possible? 2) If so, what function do I use and how do I set it up? Thanks in
advance for the assitance.
 
M

Mike H.

I would do it with a macro. Much easier. This on works:


Sub Doit()
Dim X As Double
Dim Consecutive As Double

Cells(2, 1).Select
Let X = ActiveCell.Row
Do While True
If Cells(X, 1).Value = Empty Then
Exit Do 'if there are no more names, stop
End If
For y = 1 To 31 'up 29 31 days in the month
If Cells(X, y + 2).Value > 2.75 Then
Consecutive = Consecutive + 1
If Consecutive = 3 Then
Exit For 'if I get 3
End If
ElseIf Cells(X, y + 2).Value <= 2.75 And Cells(X, y + 2).Value <>
Empty Then
Consecutive = 0
End If
Next
If Consecutive > 2 Then
Cells(X, 2).Value = "Yes"
Else
Cells(X, 2).Value = "No"
End If
X = X + 1
Loop

End Sub
 

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