Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

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.

Convert text strings to formulas with User Defined Function

Convert text strings to formulas with Kutools for Excel


arrow blue right bubble Convert text strings to formulas with User Defined Function


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:

doc-convert-text--to-formula1

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:

doc-convert-text--to-formula1


arrow blue right bubble Convert text strings to formulas with Kutools for Excel

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.

Kutools for Excel includes more than 300 handy Excel tools. Free to try with no limitation in 30 days. Get it Now.

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:

doc-convert-text--to-formula1

3. And all your selected text strings have been converted to real formulas and get their values as well. See screenshots:

doc-convert-text--to-formula4 -2 doc-convert-text--to-formula5

To know more about this Convert Text to Formula feature.


Related article:

How to convert formula to text string in Excel?


Recommended Productivity Tools

Ribbon of Excel (with Kutools for Excel installed)

300+ Advanced Features Increase Your Productivity by 71%, and Help You To Stand Out From Crowd!

Would you like to complete your daily work quickly and perfectly? Kutools For Excel brings 300+ cool and powerful advanced features (Combine workbooks, sum by color, split cell contents, convert date, and so on...) for 1500+ work scenarios, helps you solve 82% Excel problems.

  •  Deal with all complicated tasks in seconds, help to enhance your work ability, get success from the fierce competition, and never worry about being fired.
  •  Save a lot of work time, leave much time for you to love and care the family and enjoy a comfortable life now.
  •  Reduce thousands of keyboard and mouse clicks every day, relieve your tired eyes and hands, and give you a healthy body.
  •  Become an Excel expert in 3 minutes, and get admiring glance from your colleagues or friends.
  •  No longer need to remember any painful formulas and VBA codes, have a relaxing and pleasant mind, give you a thrill you've never had before.
  •  Spend only $39, but worth than $4000 training of others. Being used by 110,000 elites and 300+ well-known companies.
  •  60-day unlimited free trial. 60-day money back guarantee. Free upgrade and support for 2 years. Buy once, use forever.
  •  Change the way you work now, and give you a better life immediately!

Office Tab Brings Efficient And Handy Tabs to Office (include Excel), Just Like Chrome, Firefox, And New IE

  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Open and create documents in new tabs of same window, rather than in new windows.
  • Help you work faster and easily stand out from the crowd! One second to switch between dozens of open documents!
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    willyfred · 1 years ago
    Hello Johnny
    about Hussein’s issue, if the external workbook is closed INDIRECT gives #REF! error. Do you have other solution?
    • To post as a guest, your comment is unpublished.
      Hasan nasralla · 1 years ago
      use indirect only works with open workbooks.


      solution is to use indirect.ext from morefunc.


      regards,
      Hasan nasralla
  • To post as a guest, your comment is unpublished.
    Johnny · 1 years ago
    Hi Hussein,

    Just use the INDIRECT function in Excel. Does the same thing.
  • To post as a guest, your comment is unpublished.
    Hussein · 1 years ago
    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))).
  • To post as a guest, your comment is unpublished.
    Tamarind · 1 years ago
    The replace = with = works, so relieved. Thank you to whoever discovered and shared this nugget of Excel gold.
  • To post as a guest, your comment is unpublished.
    Rich · 2 years ago
    To clarify my other comment, I mass replaced the "=" character with the same "=" character, and that made the strings turn into formulas.