I’ve got something to analyze today. Given is a value “MyValue”, on the basis of which a value “Difference” should be calculated.
Does anyone recognize a pattern, an algorithm, from my manual Select…Case…query? What could this algorithm look like without having to specify a single case for all areas?
[code]Select Case MyValue
Case 3
Difference = 0.5
Case 4
Difference = 0.75
// Following results: Steps 2
Case 5 To 6
Difference = 1
Case 7 To 8
Difference = 1.25
// Following results: Steps 5
Case 9 To 13
Difference = 2
Case 14 To 18
Difference = 3
Case 19 To 23
Difference = 4
Case 24 To 28
Difference = 5
Case 29 To 33
Difference = 6
Case 34 To 38
Difference = 7
// Following results: Steps 4
Case 39 To 42
Difference = 8
Case 43 To 46
Difference = 9
Case 47 To 50
Difference = 10
// And so on…
End Select[/code]