How to convert text strings to formulas in Excel?
If there are lots of text strings as =A1 + B1 format which you need to convert these text strings to real formulas and calculate their values in your worksheet, unfortunately, there is no direct method to solve it in Excel. But, here I can talk about some interesting tricks for you.
- Reuse Anything: Add the most used or complex formulas, charts and anything else to your favorites, and quickly reuse them in the future.
- More than 20 text features: Extract Number from Text String; Extract or Remove Part of Texts; Convert Numbers and Currencies to English Words.
- Merge Tools: Multiple Workbooks and Sheets into One; Merge Multiple Cells/Rows/Columns Without Losing Data; Merge Duplicate Rows and Sum.
- Split Tools: Split Data into Multiple Sheets Based on Value; One Workbook to Multiple Excel, PDF or CSV Files; One Column to Multiple Columns.
- Paste Skipping Hidden/Filtered Rows; Count And Sum by Background Color; Send Personalized Emails to Multiple Recipients in Bulk.
- Super Filter: Create advanced filter schemes and apply to any sheets; Sort by week, day, frequency and more; Filter by bold, formulas, comment...
- More than 300 powerful features; Works with Office 2007-2019 and 365; Supports all languages; Easy deploying in your enterprise or organization.
The following short VBA code can help you to deal with the problem that convert text to formula as these steps:
1. Hold down the ALT + F11 keys, and it opens the Microsoft Visual Basic for Applications window.
2. Click Insert > Module, and paste the following code in the Module Window.
VBA code: Convert text strings to formulas
Function Eval(Ref As String) Application.Volatile Eval = Evaluate(Ref) End Function
3. Save this code and return to your worksheet, enter this formula =Eval(C1) into a blank cell (C1 contains the text string cell which you want to convert to formula), see screenshot:
4. Then press Enter key, and select cell D1, drag the fill handle to the range which you want to apply this formula. See screenshot:
If you don’t like use the above code, you can apply Kutools for Excel’s Convert Text to Formula feature, with its help, you can also convert text strings to formulas at once.
After installing Kutools for Excel, please do as this:
1. Select the text strings that you want to convert.
2. Click Kutools > Content Converter > Convert Text to Formula, see screenshot:
3. And all your selected text strings have been converted to real formulas and get their values as well. See screenshots: