Customize the piecewise function/find the Nth score, friends in need can refer to it. Copy the code code as follows:
Function splitx(strs1 As String, strs2 As String, n As Integer)
'Custom segmentation function splitx([string], separator, nth segment)
Dim groupST() As String
groupST = Split(strs1, strs2)
If UBound(groupST) < n - 1 Then
splitx=0
Else
splitx = groupST(n - 1)
End If
End Function
'/------------------------------------------
Function minx(KSMC As String, lb As String, kmi As String, n As String)
'Nth place score minx([exam name],[category],[subject],n)
Dim con As Object
Dim RS As Object
Dim stsql As String
Dim kmf As String
kmf = Mid(kmi, 1, 1) & group
Set con = Application.CurrentProject.Connection
Set RS = CreateObject(ADODB.Recordset)
STRSQL = SELECT top 1 & kmi & as standard score FROM score list
STRSQL = STRSQL + WHERE ((( & kmf & ) <= & n & ) And ((category) = ' & lb & ' and exam name=' & KSMC & '))
STRSQL = STRSQL + ORDER BY & kmi
RS.Open STRSQL, con, 3, 3
If RS.EOF Then
minx = 0
Else
minx = RS(standard score)
End If
RS.Close
Set RS = Nothing
Set con=Nothing
End Function