We help IT Professionals succeed at work.

# Match Formula?

on
279 Views
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
Comment
Watch Question
Most Valuable Expert 2012
Top Expert 2012
Commented:
This problem has been solved!
###### Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

Deciding to stick with EE.

Mohamed Asif

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant