How to convert formula to text string in Excel?
Normally Microsoft Excel will show the calculated results when you enter formulas in cells. However, sometimes you may need to show only the formula in cell, such as =CONCATENATE("000", " - 2"), how will you deal with it? There are several ways to solve this problem:
Convert formula to text string with Find and Replace feature
Convert formula to text string with User Defined Function
Convert formula to text string or vice versa with only one click
Convert formula to text strings quickly and easily: Kutools for Excel's Convert Formula to Text utility can help you convert the formula calculated results to plain text strings as quickly as you can. Kutools for Excel: with more than 200 handy Excel add-ins, free to try with no limitation in 60 days. Download and free trial Now! |
Convert formula to text string with Find and Replace feature
Supposing you have a range of formulas in Column C, and you need to show the column with original formulas but not their calculated results as following screenshots shown:
To solve this job, the Find and Replace feature may help you, please do as follows:
1. Select the calculated result cells that you want to convert to text string.
2. Then press Ctrl + H keys together to open the Find and Replace dialog box, in the dialog, under the Replace tab, enter equal = sign into the Find what text box, and enter '= into the Replace with text box, see screenshot:
3. Then click Replace All button, you can see all the calculated results are replaced with the original formula text strings, see screenshot:
Convert formula to text string with User Defined Function
The following VBA code also can help you easily deal with it.
1. Hold down the Alt + F11 keys in Excel, and it opens the Microsoft Visual Basic for Applications window.
2. Click Insert > Module, and paste the following macro in the Module Window.
Function ShowF(Rng As Range) ShowF = Rng.Formula End Function
3. In a blank cell, such as Cell D2, enter a formula =ShowF(C2).
4. Then click the Cell D2, and drag the Fill Handle to the range that you need.
Convert formula to text string or vice versa with only one click
If you have Kutools for Excel, with its Convert Formula to Text function, you can change multiple formulas to text strings with only one click.
Kutools for Excel : with more than 120 handy Excel add-ins, free to try with no limitation in 60 days. |
After installing Kutools for Excel, please do as this:
1. Select the formulas that you want to convert.
2. Click Kutools > Content > Convert Formula to Text, and your selected formulas have been converted to text strings at once, see screenshot:
Tips: If you want to convert the formula text strings back to the calculated results, please just apply the Convert Text to Formula utility as following screenshot shown:
If you want to know more about this feature, please visit Convert Formula to Text.
Download and free trial Kutools for Excel Now !
Demo: Convert formula to text string or vice versa with Kutools for Excel
Kutools for Excel: with more than 200 handy Excel add-ins, free to try with no limitation in 60 days. Download and free trial Now!
Recommended Productivity Tools
Office Tab
Bring handy tabs to Excel and other Office software, just like Chrome, Firefox and new Internet Explorer.
Kutools for Excel
Amazing! Increase your productivity in 5 minutes. Don't need any special skills, save two hours every day!
200 New Features for Excel, Make Excel Much Easy and Powerful:
- Merge Cell/Rows/Columns without Losing Data.
- Combine and Consolidate Multiple Sheets and Workbooks.
- Compare Ranges, Copy Multiple Ranges, Convert Text to Date, Unit and Currency Conversion.
- Count by Colors, Paging Subtotals, Advanced Sort and Super Filter,
- More Select/Insert/Delete/Text/Format/Link/Comment/Workbooks/Worksheets Tools...
Comments
e.g. I have VLOOKUP formula in column B, that returns text string based on value chosen in column A. I need to be able to edit the returned value in column B - have visible the returned text, not the formula, when I click on the cell.
1. Select the cells containing the formulas.
2. Press Ctrl+H
3. Find what: =
Replace with: '=
4. Replace all
This same trick is also quite useful when you need to work with formulas and not have them change relatively when you're moving them around or transposing them.
My question is, how do I change them back later? When I try to replace '= with = then I get the message "...cannot find any data to replace."
Turns out Excel has no simple way to change the '= back to = (kb/124739 explains this surprising fact).
Almost any other character will do, a double quote appears to work, i.e. " , or any string, e.g. XXX=
Also, notice that repeatedly pressing CtrlZ and CtrlY after the replace all will toggle the formulas on and off (so to speak) making it easy to confirm you notice all the formulas. ($0.10)
if there is a cell (text) '10+20'
I want a cell to show the result 30
I tried Rng.value or Rng.calcultate but don't work ,
what should i do ?
1. Create a text string elsewhere which includes the equals sign eg.
=CONCATENATE("@=",A1)
2. This will give you @=10+20, which you can now copy (paste values) to wherever you want it.
3. Finally, simply replace the @= with = using Ctrl+H as above.
It's three steps, but it avoids VBA and doesn't take long.
I simply need to construct the file name (eg C:Docs\Research \...\[Year72.xl sx]Test!$B$10 ro retrieve the data out of that particular file cell B10. I can build the file name in the working workbook,and create the address (using Address), but cannot extract the data in that file cell using Indirect, as Indirect does not access closed files, and opening so many files is not an option. Have we got Microsoft or is there a workaround? as this requirement must be common.
:
Any suggestions?
For Example
115 gm (this is in shown as text) I need only 115 in next column to sort.
Please reply help in this regards
897/5000
Hi, if the numbers inside the text string are in correlative form, try this, in the formula bar type B1 (if the data column is in A1):
= MID (A1, MIN (IFERROR (FIND ({0; 1; 2; 3; 4; 5; 6; 7; 8; 9}, A1), "")), COUNT (1: $ 98), 1)))
And then press Ctrl + Shift + Enter because it is a matrix formula, ie at the beginning and end of the formula will appear {y}.
Note that I use the comma (,), but it is likely that you must use the semicolon (;) to create both the array of digits and to separate the arguments of the function.
I apologize if there is something wrong with the translation from Spanish, if it gives you an error in case I copy the formula in that language:
= EXTRACT (A1, MIN (IF YOU FIND ({0; 1; 2; 3; 4; 5; 6; 7; 8; 9}, A1) , FILA ($ 1: $ 98), 1)))
Original by Moisés Ortíz (https://exceltotal.com/extraer-numeros-de-una-celda-en-excel/)