# Help on array formula conversion

#### dmark224

##### New Member
hi good day/evening,

I am new to this forums and I want to thank everyone in advance,

can someone help me with my array problem, I wan to be able to compare a cell on a list. with this formula

COLUMN C is the list
 APPLE BANANA STRAWBERRY PINEAPPLE ORANGE

COLUMN D is the what i want to compare to every row on the list
Bananna

COLUMN E is
=len(C2)

=SUMPRODUCT(--(LEFT(C2,ROW(INDIRECT("c1:c" & E2)))=LEFT(D2,ROW(INDIRECT("c1:c" &E2)))))
this works on side by side comparisson, I would like to compare all what is in the list on column C with what is in the cell in D2. then retaining the maximum value
compare C2=D2 , C3=D2, C4=D2, C5=D2 and so on.

somewhat like this

=MAX(SUMPRODUCT(--(LEFT(C2,ROW(INDIRECT("c1:c" & E2)))=LEFT(D2,ROW(INDIRECT("c1:c" &E2))))),SUMPRODUCT(--(LEFT(C3,ROW(INDIRECT("c1:c" & E2)))=LEFT(D2,ROW(INDIRECT("c1:c" &E2))))),SUMPRODUCT(--(LEFT(C4,ROW(INDIRECT("c1:c" & E2)))=LEFT(D2,ROW(INDIRECT("c1:c" &E2))))),SUMPRODUCT(--(LEFT(C5,ROW(INDIRECT("c1:c" & E2)))=LEFT(D2,ROW(INDIRECT("c1:c" &E2))))),SUMPRODUCT(--(ISNUMBER(SEARCH(MID(C5,ROW(INDIRECT("c1:c" & E2)),1),D2)))))

another formula that I need to address is

=SUMPRODUCT(--(ISNUMBER(SEARCH(MID(C2,ROW(INDIRECT("c1:c" & E2)),1),D2))))
this works on side by side comparisson, I would like to compare a list on column C with a cell. then retaining the maximum value
compare C2=D2 , C3=D2, C4=D2, C5=D2 and so on.

=MAX(SUMPRODUCT(--(ISNUMBER(SEARCH(MID(C2,ROW(INDIRECT("c1:c" & E2)),1),D2)))),SUMPRODUCT(--(ISNUMBER(SEARCH(MID(C3,ROW(INDIRECT("c1:c" & E2)),1),D2)))),SUMPRODUCT(--(ISNUMBER(SEARCH(MID(C4,ROW(INDIRECT("c1:c" & E2)),1),D2)))),SUMPRODUCT(--(ISNUMBER(SEARCH(MID(C5,ROW(INDIRECT("c1:c" & E2)),1),D2)))),SUMPRODUCT(--(ISNUMBER(SEARCH(MID(C6,ROW(INDIRECT("c1:c" & E2)),1),D2)))))

but the list can go as long as there is data from the list (column c) "may use counta"

I am not using index match because this would only look for exact match. I want to be able to decide the percentage of approximate searching.

Thank you in advance

### Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!

#### kweaver

##### Well-known Member
Welcome to Mr. Excel. It would help anyone trying to assist if you'd (a) use XL2BB to show your sample data and (b) provide expected results.

#### dmark224

##### New Member
sorry i have to re-write my question COLUMN E is Len(D2)

hi good day/evening,

I am new to this forums and I want to thank everyone in advance,

can someone help me with my array problem, I wan to be able to compare a cell on a list. with this formula

COLUMN C is the list

 APPLE BANANA STRAWBERRY PINEAPPLE ORANGE

COLUMN D is the what i want to compare to every row on the list
Bananna

COLUMN E is
=len(D2)

=SUMPRODUCT(--(LEFT(C2,ROW(INDIRECT("c1:c" & E2)))=LEFT(D2,ROW(INDIRECT("c1:c" &E2)))))
this works on side by side comparisson, I would like to compare all what is in the list on column C with what is in the cell in D2. then retaining the maximum value
compare C2=D2 , C3=D2, C4=D2, C5=D2 and so on.

somewhat like this
=MAX(SUMPRODUCT(--(LEFT(C2,ROW(INDIRECT("c1:c" & E2)))=LEFT(D2,ROW(INDIRECT("c1:c" &E2))))),SUMPRODUCT(--(LEFT(C3,ROW(INDIRECT("c1:c" & E2)))=LEFT(D2,ROW(INDIRECT("c1:c" &E2))))),SUMPRODUCT(--(LEFT(C4,ROW(INDIRECT("c1:c" & E2)))=LEFT(D2,ROW(INDIRECT("c1:c" &E2))))),SUMPRODUCT(--(LEFT(C5,ROW(INDIRECT("c1:c" & E2)))=LEFT(D2,ROW(INDIRECT("c1:c" &E2))))),SUMPRODUCT(--(ISNUMBER(SEARCH(MID(C5,ROW(INDIRECT("c1:c" & E2)),1),D2)))),SUMPRODUCT(--(ISNUMBER(SEARCH(MID(C6,ROW(INDIRECT("c1:c" & E2)),1),D2)))))

and per character

=SUMPRODUCT(--(ISNUMBER(SEARCH(MID(D2,ROW(INDIRECT("c1:c" & E2)),1),C2))))
this works on side by side comparisson, I would like to compare all what is in the list on column C with what is in the cell in D2. then retaining the maximum value
compare C2=D2 , C3=D2, C4=D2, C5=D2 and so on.

=MAX(SUMPRODUCT(--(ISNUMBER(SEARCH(MID(D2,ROW(INDIRECT("c1:c" & E2)),1),C2)))),SUMPRODUCT(--(ISNUMBER(SEARCH(MID(D2,ROW(INDIRECT("c1:c" & E2)),1),C3)))),SUMPRODUCT(--(ISNUMBER(SEARCH(MID(D2,ROW(INDIRECT("c1:c" & E2)),1),C4)))),SUMPRODUCT(--(ISNUMBER(SEARCH(MID(D2,ROW(INDIRECT("c1:c" & E2)),1),C5)))),SUMPRODUCT(--(ISNUMBER(SEARCH(MID(D2,ROW(INDIRECT("c1:c" & E2)),1),C6)))))

but the list can go as long as there is data from the list (column c) "may use counta"

I am not using index match because this would only look for exact match. I want to be able to decide the percentage of approximate searching.

Thank you in advance

attaching excel file.

approximatelookupBetter.xlsx
ABCDEFGHI
1LIST SUBCOMPARE SUBcompare left to rightcompare per characterresult that I want with out manual input per row left to rightresult that I want with out manual input per row per character
2APPLEstrawbery90289
3BANANAbaanan62626
4STRAWBERRYpineapple90399
5PINEAPPLEorange60366
6ORANGEapple50255
Sheet1
Cell Formulas
RangeFormula
E2:E6E2=LEN(D2)
F2:F6F2=SUMPRODUCT(--(LEFT(C2,ROW(INDIRECT("c1:c" & E2)))=LEFT(D2,ROW(INDIRECT("c1:c" &E2)))))
G2:G6G2=SUMPRODUCT(--(ISNUMBER(SEARCH(MID(D2,ROW(INDIRECT("c1:c" & E2)),1),C2))))
H2:H6H2=MAX(SUMPRODUCT(--(LEFT(\$C\$2,ROW(INDIRECT("c1:c" & E2)))=LEFT(D2,ROW(INDIRECT("c1:c" &E2))))),SUMPRODUCT(--(LEFT(\$C\$3,ROW(INDIRECT("c1:c" & E2)))=LEFT(D2,ROW(INDIRECT("c1:c" &E2))))),SUMPRODUCT(--(LEFT(\$C\$4,ROW(INDIRECT("c1:c" & E2)))=LEFT(D2,ROW(INDIRECT("c1:c" &E2))))),SUMPRODUCT(--(LEFT(\$C\$5,ROW(INDIRECT("c1:c" & E2)))=LEFT(D2,ROW(INDIRECT("c1:c" &E2))))),SUMPRODUCT(--(ISNUMBER(SEARCH(MID(C5,ROW(INDIRECT("c1:c" & E2)),1),D2)))),SUMPRODUCT(--(ISNUMBER(SEARCH(MID(\$C\$6,ROW(INDIRECT("c1:c" & E2)),1),D2)))))
I2:I6I2=MAX(SUMPRODUCT(--(ISNUMBER(SEARCH(MID(D2,ROW(INDIRECT("c1:c" & E2)),1),\$C\$2)))),SUMPRODUCT(--(ISNUMBER(SEARCH(MID(D2,ROW(INDIRECT("c1:c" & E2)),1),\$C\$3)))),SUMPRODUCT(--(ISNUMBER(SEARCH(MID(D2,ROW(INDIRECT("c1:c" & E2)),1),\$C\$4)))),SUMPRODUCT(--(ISNUMBER(SEARCH(MID(D2,ROW(INDIRECT("c1:c" & E2)),1),\$C\$5)))),SUMPRODUCT(--(ISNUMBER(SEARCH(MID(D2,ROW(INDIRECT("c1:c" & E2)),1),\$C\$6)))))

Replies
1
Views
70
Replies
10
Views
190
Replies
10
Views
589
Replies
3
Views
96
Replies
2
Views
67

Threads
1,127,387
Messages
5,624,389
Members
416,026
Latest member
melvic69

### Share this page ### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

### Which adblocker are you using?    ### Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option. Go back

### Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com". Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button. Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button. Go back