Hello I want to ask you if there is a function to do following:
In first cell I have text string for example 2+8+3*5+2,35+7
In second cell a want to have result of calculation this string in first cell.
I don't want to change first cell and put "=" before string in first cell to calculate it there ....
Thank you a lot.
[Solved] Formula to number
[Solved] Formula to number
Last edited by MrProgrammer on Sun Aug 02, 2020 7:34 pm, edited 1 time in total.
Reason: Tagged ✓ [Solved]
Reason: Tagged ✓ [Solved]
openoffice 3.4.1 Windows 7
Re: formula to number
menu:Insert>Names>Define...[ctrl+F3]
Enter some name, say F, and enter formula, click [Add] and [OK]
=F gives the result in any cell.
Enter some name, say F, and enter formula, click [Add] and [OK]
=F gives the result in any cell.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: formula to number
Thank you, but this is not what I need.
I have cell A1 that contains string - mathematical notation (numbers and operators) and I need another cell A2 that will refer to cell A1 and show result of A1.
So if I change notation in cell A1, it will automatically change result in A2.
So if I put to A1 text string 3+6+1 than A2 will show 10.
I have cell A1 that contains string - mathematical notation (numbers and operators) and I need another cell A2 that will refer to cell A1 and show result of A1.
So if I change notation in cell A1, it will automatically change result in A2.
So if I put to A1 text string 3+6+1 than A2 will show 10.
openoffice 3.4.1 Windows 7
- MrProgrammer
- Moderator
- Posts: 5454
- Joined: Fri Jun 04, 2010 7:57 pm
- Location: Wisconsin, USA
Re: formula to number
Hi, and welcome to the forum.
But you can do the reverse. Type =2+8+3*5+2,35+7 in the second cell and use =MID(FORMULA(cell);2;65535) in the first cell. When you change the second cell, the first one is automatically updated.
I suspect the following suggestion won't be "automatic" enough for you. If the text strings are in one column and you want the formulas in a second column you can use Edit > Copy on the first column, Edit > Paste on the second column and then, with the cells of the second column selected use Edit > Find & Replace > More options, select Current selection only and Regular Expressions, Search for .*, Replace with =&, Replace All. I recommend unchecking Current selection only and Regular expressions, before clicking Close. You can record a macro (Tools > Macros > Record) to perform these Copy/Paste/Replace steps. (I tested that.)
If this answered your question please go to your first post use the Edit button and add [Solved] to the start of the title. You can select the green checkmark icon at the same time.
No. We could have a function (presumably called EVAL) which evaluates a text string the same way that the formula processor would. If so, =EVAL("1+2") would be 3; or with A1 containing "SUM", =EVAL(A1&"(C4:C6)") would sum the numbers in C4 through C6. However neither Calc nor any spreadsheet I'm familiar with has implemented an EVAL function.laco1234 wrote:Hello I want to ask you if there is a function to do following: In first cell I have text string for example 2+8+3*5+2,35+7. In second cell a want to have result of calculation this string in first cell.
But you can do the reverse. Type =2+8+3*5+2,35+7 in the second cell and use =MID(FORMULA(cell);2;65535) in the first cell. When you change the second cell, the first one is automatically updated.
I suspect the following suggestion won't be "automatic" enough for you. If the text strings are in one column and you want the formulas in a second column you can use Edit > Copy on the first column, Edit > Paste on the second column and then, with the cells of the second column selected use Edit > Find & Replace > More options, select Current selection only and Regular Expressions, Search for .*, Replace with =&, Replace All. I recommend unchecking Current selection only and Regular expressions, before clicking Close. You can record a macro (Tools > Macros > Record) to perform these Copy/Paste/Replace steps. (I tested that.)
If this answered your question please go to your first post use the Edit button and add [Solved] to the start of the title. You can select the green checkmark icon at the same time.
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.7.8, iMac Intel. The locale for any menus or Calc formulas in my posts is English (USA).
AOO 4.1.7 Build 9800, MacOS 13.7.8, iMac Intel. The locale for any menus or Calc formulas in my posts is English (USA).
Re: formula to number
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice