Assuming your Source
and Dest
columns are always parsable as numbers, you could add a new column that calculates your path...something like =MIN([@Source],[@Dest]) & " ->
" & MAX([@Source],[@Dest])
.
Then, your pivot table would just have this field as the rows, and the cable type as the column:

However, this doesn't take into account values not parsable as numbers (e.g. 1.1.1
or values that are the same when parsed as numbers but semantically different (e.g. 1.1
and 1.10
).
To get around this, you could create 2 user-defined functions in VBA, and call them from Excel. I'm not sure if you're familiar at all with VBA (I know your question certainly wasn't tagged VBA
. A good introduction to writing VBA functions in Excel can be found here. You'll want functions like the following:
Option Explicit
Public Function StringMax(rng As Excel.Range, Optional ignoreCase As Boolean = True) As Variant
Dim cell As Excel.Range, maxValue As String, comp As VbCompareMethod
If ignoreCase Then
comp = vbTextCompare
Else
comp = vbBinaryCompare
End If
' make sure the range you're passing in only has 1 column
If rng.Columns.Count > 1 Then
StringMax = CVErr(XlCVError.xlErrNA)
Else
' loop through cells in the range, checking if each one is > the current max
StringMax = CStr(rng.Cells(1, 1).Value)
For Each cell In rng.Cells
If VBA.StrComp(CStr(cell.Value), StringMax, comp) > 0 Then
StringMax = CStr(cell.Value)
End If
Next cell
End If
End Function
Public Function StringMin(rng As Excel.Range, Optional ignoreCase As Boolean = True) As Variant
Dim cell As Excel.Range, maxValue As String, comp As VbCompareMethod
If ignoreCase Then
comp = vbTextCompare
Else
comp = vbBinaryCompare
End If
' make sure the range you're passing in only has 1 column
If rng.Columns.Count > 1 Then
StringMin = CVErr(XlCVError.xlErrNA)
Else
' loop through each cell in the range, checking if each one is < the current max
StringMin = CStr(rng.Cells(1, 1).Value)
For Each cell In rng.Cells
If VBA.StrComp(CStr(cell.Value), StringMin, comp) < 0 Then
StringMin = CStr(cell.Value)
End If
Next cell
End If
End Function