Here is the code, I didn't think it would be that relevant as I figured this may be an excel glitch, but of course it helps.
Public Concatenate As String
Public Function Check(Value0 As Double, Value1 As Double, Value2 As Double, Value3 As Double, List As Range)
'Value0 is the starting value i.e. %13.2
'Value1 is the finishing value i.e. %14.1
'Value2 is the starting value's lower integer limit - %13
'Value3 is the starting value's upper integer limit - 14%
Dim totalPos As Double
Dim intTotal As Long
Dim roundedUp As Double
Dim roundedDown As Double
Dim Thresholds() As Variant
Dim element As Variant
Dim startPos As Double
Dim i As Integer
Concatenate = vbNullString 'resetting string variable to null
startPos = Value0 * 100
totalPos = Value1 * 100
intTotal = Int(totalPos)
roundedDown = Value2 * 100 'lower bound of start pos
roundedUp = Value3 * 100 'upper bound of start pos
Check = "" 'init
If intTotal >= roundedUp Then
If startPos < 5 And intTotal >= 5 Then
Check = Check & " 5"
End If
aboveTenCheck intTotal, startPos
Check = Check + Concatenate
ElseIf intTotal <= roundedDown Then
If startPos >= 5 And intTotal < 5 Then
Check = Check & " 5"
End If
aboveTenCheck intTotal, startPos
Check = Check + Concatenate
End If
If Check = 0 Or Check = "" Then
Check = "N/A" 'in the event that no action is needed
End If
End Function
Public Sub aboveTenCheck(finalPosition, startingPosition)
For i = 10 To 29
If startingPosition < i And finalPosition >= i Then
Concatenate = Concatenate & " " & i
ElseIf startingPosition >= i And finalPosition < i Then
Concatenate = Concatenate & " " & i
End If
Next i
End Sub
I can't show the exact output but I added in examples of what the input values would be. Hope this enough info..!