# Question : INDEX/MATCH formula that will identify multiple matches

## Answer : INDEX/MATCH formula that will identify multiple matches

##### I haven't tested the other suggestions, so my apologies if I am offering something that's already been tried :)This works as a function.  So, if you have your 1s and 0s in, say, A1:A50, then in another cell you would use:=MakeTheList(A1:A50) ```1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: ``` ```Function MakeTheList(ArrayIn As Variant) Dim x As Variant Dim StartAt As Long, EndAt As Long Dim Counter As Long Const Delimiter As String = ", " For Each x In ArrayIn Counter = Counter + 1 If x <> 0 Then EndAt = Counter If StartAt = 0 Then StartAt = Counter Else If EndAt <> 0 Then If StartAt <> EndAt Then MakeTheList = MakeTheList & Delimiter & StartAt & "-" & EndAt Else MakeTheList = MakeTheList & Delimiter & StartAt End If StartAt = 0 EndAt = 0 End If End If Next If StartAt <> 0 Then If StartAt <> EndAt Then MakeTheList = MakeTheList & Delimiter & StartAt & "-" & EndAt Else MakeTheList = MakeTheList & Delimiter & StartAt End If End If MakeTheList = Mid(MakeTheList, Len(Delimiter)) End Function```
 Random Solutions