Saltar al contenido principal

¿Cómo convertir cadenas de texto a fórmulas en Excel?

Si hay muchas cadenas de texto con el formato = A1 + B1 que necesita para convertir estas cadenas de texto en fórmulas reales y calcular sus valores en su hoja de trabajo, desafortunadamente, no existe un método directo para resolverlo en Excel. Pero aquí puedo hablarte de algunos trucos interesantes para ti.

Convierta cadenas de texto en fórmulas con la función definida por el usuario

Convierta cadenas de texto en fórmulas con Kutools para Excel


flecha azul burbuja derecha Convierta cadenas de texto en fórmulas con la función definida por el usuario

El siguiente código corto de VBA puede ayudarlo a lidiar con el problema de convertir texto en fórmula siguiendo estos pasos:

1. Mantenga pulsado el ALT + F11 llaves, y abre el Ventana de Microsoft Visual Basic para aplicaciones.

2. Hacer clic recuadro > Móduloy pegue el siguiente código en el Ventana de módulo.

Código VBA: convierta cadenas de texto en fórmulas

Function Eval(Ref As String)
Application.Volatile
Eval = Evaluate(Ref)
End Function

3. Guarde este código y regrese a su hoja de trabajo, ingrese esta fórmula = Eval (C1) en una celda en blancoC1 contiene la celda de cadena de texto que desea convertir a fórmula), vea la captura de pantalla:

doc-convertir-texto - a-fórmula1

4. Entonces presione Participar y seleccione la celda D1, arrastre el controlador de relleno al rango al que desea aplicar esta fórmula. Ver captura de pantalla:

doc-convertir-texto - a-fórmula1


flecha azul burbuja derecha Convierta cadenas de texto en fórmulas con Kutools para Excel

Si no le gusta usar el código anterior, puede solicitar Kutools for Excel, Convertir texto en fórmula característica, con su ayuda, también puede convertir cadenas de texto en fórmulas a la vez.

Kutools for Excel incluye más de 300 útiles herramientas de Excel. Prueba gratis sin límite en 30 días. Comprar ahora .

Después de instalar Kutools para Excel, haga lo siguiente:

1. Seleccione las cadenas de texto que desea convertir.

2. Hacer clic Kutools > Convertidor de contenido > Convertir texto en fórmula, ver captura de pantalla:

doc-convertir-texto - a-fórmula1

3. Y todas las cadenas de texto seleccionadas se han convertido en fórmulas reales y también obtienen sus valores. Ver capturas de pantalla:

doc-convertir-texto - a-fórmula4 -2 doc-convertir-texto - a-fórmula5

Para saber más sobre esta función Convertir texto en fórmula.


Artículo relacionado:

¿Cómo convertir una fórmula a una cadena de texto en Excel?

Las mejores herramientas de productividad de oficina

🤖 Asistente de IA de Kutools: Revolucionar el análisis de datos basado en: Ejecución inteligente   |  Generar codigo  |  Crear fórmulas personalizadas  |  Analizar datos y generar gráficos  |  Invocar funciones de Kutools...
Características populares: Buscar, resaltar o identificar duplicados   |  Eliminar filas en blanco   |  Combine columnas o celdas sin perder datos   |   Ronda sin fórmula ...
Super búsqueda: Búsqueda virtual de criterios múltiples    Búsqueda V de valores múltiples  |   VLookup en varias hojas   |   Búsqueda difusa ....
Lista desplegable avanzada: Crear rápidamente una lista desplegable   |  Lista desplegable dependiente   |  Lista desplegable de selección múltiple ....
Administrador de columnas: Agregar un número específico de columnas  |  Mover columnas  |  Toggle Estado de visibilidad de columnas ocultas  |  Comparar rangos y columnas ...
Características destacadas: Enfoque de cuadrícula   |  Vista de diseño   |   Gran barra de fórmulas    Administrador de hojas y libros de trabajo   |  Biblioteca de Recursos (Texto automático)   |  Selector de fechas   |  Combinar hojas de trabajo   |  Cifrar/descifrar celdas    Enviar correos electrónicos por lista   |  Súper filtro   |   Filtro especial (filtro negrita/cursiva/tachado...) ...
Los 15 mejores conjuntos de herramientas12 Texto Herramientas (Añadir texto, Quitar caracteres, ...)   |   50+ Tabla Tipos (Diagrama de Gantt, ...)   |   40+ Práctico Fórmulas (Calcular la edad según el cumpleaños, ...)   |   19 Inserción Herramientas (Insertar código QR, Insertar imagen desde la ruta, ...)   |   12 Conversión Herramientas (Números a palabras, Conversión de Moneda, ...)   |   7 Fusionar y dividir Herramientas (Filas combinadas avanzadas, Células partidas, ...)   |   ... y más

Mejore sus habilidades de Excel con Kutools for Excel y experimente la eficiencia como nunca antes. Kutools for Excel ofrece más de 300 funciones avanzadas para aumentar la productividad y ahorrar tiempo.  Haga clic aquí para obtener la función que más necesita...

Descripción


Office Tab lleva la interfaz con pestañas a Office y hace que su trabajo sea mucho más fácil

  • Habilite la edición y lectura con pestañas en Word, Excel, PowerPoint, Publisher, Access, Visio y Project.
  • Abra y cree varios documentos en nuevas pestañas de la misma ventana, en lugar de en nuevas ventanas.
  • ¡Aumenta su productividad en un 50% y reduce cientos de clics del mouse todos los días!
Comments (16)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
I am finding this to be not working properly. As everyone else has said (and I could not see a satisfactory solution), it does not work when trying to pull in stuff from other worksheets in the same workbook. It's frustrating and I am having to give up on this and find another solution. So the Google search continues!
This comment was minimized by the moderator on the site
Thank you very much!!! GREAT IDEA!!!
This comment was minimized by the moderator on the site
Hello
For the first defined function way, I have a problem.
when the resources for concatenate function are in another worksheet, Eval function works properly when that resource worksheet is open, But immediately when I close that resource worksheet, Eval function Not working. How I can change the codes for eval function to use closed resource worksheets?
This comment was minimized by the moderator on the site
Hello Johnny
about Hussein’s issue, if the external workbook is closed INDIRECT gives #REF! error. Do you have other solution?
This comment was minimized by the moderator on the site
use indirect only works with open workbooks.


solution is to use indirect.ext from morefunc.


regards,
Hasan nasralla
This comment was minimized by the moderator on the site
Hi Hussein,

Just use the INDIRECT function in Excel. Does the same thing.
This comment was minimized by the moderator on the site
Greetings, the above code works perfectly inside the same workbook across different sheets, but in case i have a cell reference to an external workbook it returns #VALUE!. the formulas were calculating normally earlier.
Example for the formula can't be evaluated correctly: IFERROR(INDEX('[Tracking-OSP Outside Riyadh-07-09-2017.xlsx]Tracking WO'!$U$3:$U$19000,MATCH(A3&"",'[Tracking-OSP Outside Riyadh-07-09-2017.xlsx]Tracking WO'!$B$3:$B$19000,0)),INDEX('[Tracking-OSP Outside Riyadh-07-09-2017.xlsx]Tracking WO'!$U$3:$U$19000,MATCH(value(A3),'[Tracking-OSP Outside Riyadh-07-09-2017.xlsx]Tracking WO'!$B$3:$B$19000,0))).
This comment was minimized by the moderator on the site
The replace = with = works, so relieved. Thank you to whoever discovered and shared this nugget of Excel gold.
This comment was minimized by the moderator on the site
To clarify my other comment, I mass replaced the "=" character with the same "=" character, and that made the strings turn into formulas.
This comment was minimized by the moderator on the site
Hi Rich,
I'm just reading you comment on turning text into a formula. It seems that the function as mentioned above is not working. I'm not really a programmer but what i did is converting a formula into a text and in the text i have to replace a few values and combine it again in one text but now i need to convert it back into a formula. Could you give me a tip.
Regards
Frans
This comment was minimized by the moderator on the site
I don't know if this would always work, but I had a number of cells that had formulas stored as text strings. I did a full worksheet find replace on the "=" character, and all of my strings converted to formulas with that one action.
This comment was minimized by the moderator on the site
Thank you. Works well with the user defined function... I could do what I could not using the default functions of INDIRECT, ADDRESS et al provided. It fell short when I had a range to be input.
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations