Saltar al contenido
View in the app

A better way to browse. Learn more.

Ayuda Excel

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Similitud entre celdas

publicado

Buenas tardes a todos.

Estoy buscando una macro que me calcule el porcentaje de similitud entre dos celdas.

Buscando por internet he encontrado estas macros que calculan justo lo que estaba buscando ( http://miguelmaresmahurtado.com/index.php/2016/03/14/porcentaje-de-similitud-entre-dos-textos/) pero ambas me dan error y no sé arreglarlo. 

Si alguien pudiera ayudarme o sugerirme otra macro sería de gran utilidad.

Adjunto mi ejemplo. Muchas gracias y espero que todos se encuentren sanos y en casa

Ejemplo.xlsx

Featured Replies

publicado

Lo mismo, de otra manera sin considerar los acentos.

Function Similitud_Porcentual(Cadena1 As String, Cadena2 As String) As Integer
Dim Texto1 As Variant, Texto2 As Variant, x As Integer, Veces As Integer
If Cadena1 = "" Or Cadena2 = "" Then Exit Function
'--
Cadena1 = Homogeneizar(LCase(Cadena1))
Cadena2 = Homogeneizar(LCase(Cadena2))
'--
Texto1 = Split(Cadena1)
Texto2 = Split(Cadena2)
Total = UBound(Texto1) + 1
If UBound(Texto2) > UBound(Texto1) Then Total = UBound(Texto2) + 1
'--
For x = 0 To UBound(Texto1)
   If UBound(Filter(Texto2, Texto1(x))) > -1 Then
      Veces = Veces + 1
   End If
Next
Similitud_Porcentual = Round(Veces * 100 / Total, 0)
End Function
Function Homogeneizar(Cadena As String) As String
Homogeneizar = Replace(Cadena, "á", "a")
Homogeneizar = Replace(Homogeneizar, "é", "e")
Homogeneizar = Replace(Homogeneizar, "í", "i")
Homogeneizar = Replace(Homogeneizar, "ó", "o")
Homogeneizar = Replace(Homogeneizar, "ú", "u")
Homogeneizar = Replace(Homogeneizar, "ü", "u")
End Function

 

Editado el por Antoni

Archivado

Este tema está ahora archivado y está cerrado a más respuestas.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.