Compare text cells and give a matching percentage

Maarten321

New Member
Joined
Jul 7, 2016
Messages
16
Hi guys,

I have been looking for a solution but haven't been able to find any vba or function that could do the trick.
VBA would work the best for me. The excel sheet has about 120k rows.

It has to calculate productinfo on the description or url. Some descriptions might not contain all info so that's why we also have it separated.

An example:
[TABLE="class: grid, width: 1000, align: left"]
<tbody>[TR]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]D[/TD]
[TD="align: center"]E[/TD]
[TD="align: center"]F[/TD]
[TD="align: center"]G[/TD]
[TD="align: center"]H[/TD]
[/TR]
[TR]
[TD="align: center"]Query[/TD]
[TD="align: center"]Brand[/TD]
[TD="align: center"]Productname[/TD]
[TD="align: center"]ID[/TD]
[TD="align: center"]Description[/TD]
[TD="align: center"]Url[/TD]
[TD="align: center"]Percentage1[/TD]
[TD="align: center"]Percentage2[/TD]
[/TR]
[TR]
[TD]

<colgroup><col width="px"355""></colgroup><tbody>
[TD="width: 355"]Ztahl - Dijkos Salerno 3100[/TD]

</tbody>
[/TD]
[TD]

<colgroup><col width="px"110""></colgroup><tbody>
[TD="width: 110"]Ztahl - Dijkos[/TD]

</tbody>
[/TD]
[TD]

<colgroup><col width="px"231""></colgroup><tbody>
[TD="width: 231"]Salerno[/TD]

</tbody>
[/TD]
[TD]

<colgroup><col width="px"143""></colgroup><tbody>
[TD="width: 143"]3100[/TD]

</tbody>
[/TD]
[TD][TABLE="width: 105"]
<colgroup><col></colgroup><tbody>[TR]
[TD]hanglamp-salerno-rvs-ztahl-3100 ... Ztahl 5-L Hanglamp Salerno RVS. E-mail naar een vriend. Schrijf de eerste beoordeling van dit product. € 287,00. Aantal: ...[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 87"]
<colgroup><col width="87" style="width: 65pt;"></colgroup><tbody>[TR]
[TD="class: xl63, width: 87"]http://www.xxxxxxxxxx.nl/hanglamp-salerno-rvs-ztahl-3100.html[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]

<colgroup><col width="px"355""></colgroup><tbody>
[TD="width: 355"]Ztahl - Dijkos Salerno 3100[/TD]

</tbody>
[/TD]
[TD]

<colgroup><col width="px"110""></colgroup><tbody>
[TD="width: 110"]Ztahl - Dijkos[/TD]

</tbody>
[/TD]
[TD]

<colgroup><col width="px"231""></colgroup><tbody>
[TD="width: 231"]Salerno[/TD]

</tbody>
[/TD]
[TD]

<colgroup><col width="px"143""></colgroup><tbody>
[TD="width: 143"]3100[/TD]

</tbody>
[/TD]
[TD][TABLE="width: 105"]
<colgroup><col></colgroup><tbody>[TR]
[TD]Bekijk de meubels, meubelen, bankstellen en fauteuils in de showroom en laat u verrassen door de scherpe prijzen![/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 87"]
<colgroup><col width="87" style="width: 65pt;"></colgroup><tbody>[TR]
[TD="class: xl63, width: 87"]https://www.yyyyyyyyy.nl/hanglamp-salerno-3100-dijkos-ztahl.html[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]






























Percentage1 = calculation of B,C,D on Description
Percentage2 = calculation of B,C,D on URL

What would give the most accurate results? Calculation separated B,C,D or only on A.


Sheetname = "Clean"
Tablename = "Clean"

Would be nice if the vba is configured on the table data instead of ranges because they can change from time to time.
The header names in this example are also the real headers of the table.

Help me how i can put this in a vba.

Greetz Maarten
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
I'm sorry, I want to calculate the percentage per row.

The percentage1 I want to calculate is how probable is the match of text in b,c,d. On description.

Percentage2 how probable is the match of text in b,c,d. On url.

Hope this makes it a bit clearer
 
Upvote 0
the text matches within another cell, or it doesn't

are you looking for fuzzy matching - if so I run for the hills....
 
Upvote 0

Forum statistics

Threads
1,223,239
Messages
6,170,947
Members
452,368
Latest member
jayp2104

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
Back
Top