I think this will do what you want. Select the cell in question and run this macro.
Sub test()
Dim keyCell As Range
Dim foundRight As Range, foundLeft As Range
Dim writeCell As Range
Dim Numerals As Variant, i As Long
Set keyCell = Selection.Cells(1, 1)
Numerals = Split(CStr(keyCell.Value), "-")
keyCell.Offset(0, 1).Resize(1000, 5).ClearContents
For i = 0 To UBound(Numerals)
With keyCell
With Range(.Cells(2, 1), .EntireColumn.Cells(Rows.Count, 1))
Set foundRight = .Find(Numerals(i) & "-", after:=.Cells(1, 1), LookIn:=xlValues, lookat:=xlPart, searchdirection:=xlNext)
Set foundLeft = .Find("-" & Numerals(i), after:=.Cells(1, 1), LookIn:=xlValues, lookat:=xlPart, searchdirection:=xlNext)
End With
End With
If foundRight Is Nothing And foundLeft Is Nothing Then
Set writeCell = Nothing
ElseIf foundRight Is Nothing Then
Set writeCell = foundLeft
ElseIf foundLeft Is Nothing Then
Set writeCell = foundRight
Else
Set writeCell = foundRight
If foundLeft.Row < writeCell.Row Then Set writeCell = foundLeft
End If
If Not writeCell Is Nothing Then
With writeCell
.Cells(1, Application.Match(Numerals(i), Split(.Value, "-"), 0)).Value = writeCell.Row - keyCell.Row
End With
End If
Next i
End Sub