Well I tried and this is what I figured out so far it looks at the color it a start not sure how to adapt it to do what you need

Function CombineByColor(rData As Range, cellRefColor As Range)
    Dim indRefColor As Long
    Dim cellCurrent As Range
    Dim connect_it
     
    Application.Volatile
    
    indRefColor = cellRefColor.Cells(1, 1).Interior.Color
    For Each cellCurrent In rData
        If indRefColor = cellCurrent.Interior.Color Then
            connect_it = connect_it & cellCurrent & " + "
        End If
    Next cellCurrent
 
    CombineByColor = connect_it
End Function