troubleshooting Question

# Match Formula? asked on
Microsoft Excel
Hi,

I have attached some match formula i use

Basically, i match on criteria ColB "ISIN", i look up another spreadsheet and if the ISIN is in that spreadsheet, i return the data,=

My only issue is that i cant seem to account for multiple matches on exactly the same criteria.

So if two items match my criteria, the match formula can only return one, as it is matched on a line by line basis i.e. the match formula is next to the criteria, and then it returns or not.

Is there a way i can use match criteria, so that if there is a multiple matches, it can be returned in another part of the ss, im being speculative, so am lookig for ideas!

Thanks
Seamus

I have attached a spreadsheet so you have an idea of how im matching

``````Sub x()

Dim r As Long

Sheets("Output").Select

With Sheets("Output")
r = .Range("A" & Rows.Count).End(xlUp).Row

.Range("N2").Formula = "=IF(ISNUMBER(MATCH(\$B2,'Raw Data'!\$A\$2:\$A\$1000,0)),INDEX('Raw Data'!\$B\$2:\$I\$1000,MATCH(\$B2,'Raw Data'!\$A\$2:\$A\$1000,0),COLUMNS(\$N2:N2)),"""")"
.Range("O2").Formula = "=IF(ISNUMBER(MATCH(\$B2,'Raw Data'!\$A\$2:\$A\$1000,0)),INDEX('Raw Data'!\$B\$2:\$I\$1000,MATCH(\$B2,'Raw Data'!\$A\$2:\$A\$1000,0),COLUMNS(\$N2:O2)),"""")"
.Range("P2").Formula = "=IF(ISNUMBER(MATCH(\$B2,'Raw Data'!\$A\$2:\$A\$1000,0)),INDEX('Raw Data'!\$B\$2:\$I\$1000,MATCH(\$B2,'Raw Data'!\$A\$2:\$A\$1000,0),COLUMNS(\$N2:P2)),"""")"
.Range("Q2").Formula = "=IF(ISNUMBER(MATCH(\$B2,'Raw Data'!\$A\$2:\$A\$1000,0)),INDEX('Raw Data'!\$B\$2:\$I\$1000,MATCH(\$B2,'Raw Data'!\$A\$2:\$A\$1000,0),COLUMNS(\$N2:Q2)),"""")"
.Range("R2").Formula = "=IF(ISNUMBER(MATCH(\$B2,'Raw Data'!\$A\$2:\$A\$1000,0)),INDEX('Raw Data'!\$B\$2:\$I\$1000,MATCH(\$B2,'Raw Data'!\$A\$2:\$A\$1000,0),COLUMNS(\$N2:R2)),"""")"
.Range("S2").Formula = "=IF(ISNUMBER(MATCH(\$B2,'Raw Data'!\$A\$2:\$A\$1000,0)),INDEX('Raw Data'!\$B\$2:\$I\$1000,MATCH(\$B2,'Raw Data'!\$A\$2:\$A\$1000,0),COLUMNS(\$N2:S2)),"""")"
.Range("T2").Formula = "=IF(ISNUMBER(MATCH(\$B2,'Raw Data'!\$A\$2:\$A\$1000,0)),INDEX('Raw Data'!\$B\$2:\$I\$1000,MATCH(\$B2,'Raw Data'!\$A\$2:\$A\$1000,0),COLUMNS(\$N2:T2)),"""")"
.Range("U2").Formula = "=IF(ISNUMBER(MATCH(\$B2,'Raw Data'!\$A\$2:\$A\$1000,0)),INDEX('Raw Data'!\$B\$2:\$I\$1000,MATCH(\$B2,'Raw Data'!\$A\$2:\$A\$1000,0),COLUMNS(\$N2:U2)),"""")"
.Range("M2").Formula = "=IF(N2<>"""",B2,"""")"
.Range("V2").Formula = "=IF(ISNUMBER(MATCH(\$B2,'Raw Data'!\$A\$2:\$A\$1000,0)),INDEX('Raw Data'!\$B\$2:\$J\$1000,MATCH(\$B2,'Raw Data'!\$A\$2:\$A\$1000,0),COLUMNS(\$N2:V2)),"""")"
.Range("W2").Formula = "=IF(C2=X2,""YES"",""No"")"
.Range("K2").Formula = "=IF(AA2=""Yes"",SUM(J2,I2),SUM(J2))"
.Range("Y2").Formula = "=c2*1"
.Range("Z2").Formula = "=x2*1"
.Range("AA2").Formula = "=if(Y2=Z2,""Yes"",""No"")"

.Range("K2:AA2").Copy .Range("K2:AA" & r)
End With

End Sub
``````
test.zip
###### Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.