operation in one cell and result in another one

Discuss the spreadsheet application
Post Reply
IL CAPO
Posts: 5
Joined: Wed May 07, 2008 12:05 am

operation in one cell and result in another one

Post by IL CAPO »

I need to know if there is a function to have de operation in one cell [(3+4)*2], and the result in onother [14]. Thank you
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: operation in one cell and result in another one

Post by Villeroy »

A1 =some calculation
B1: =A1 (link to A1)
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
IL CAPO
Posts: 5
Joined: Wed May 07, 2008 12:05 am

Re: operation in one cell and result in another one

Post by IL CAPO »

Hello Villeroy:
Thank you for your answer, but it doesn't work. May be I don't give a good explanation about it.
What I need is to see the operation in on cell, for instance A1: (2+3)*4, without the (=) sign and in another one B1: 20, the result of the operation.
I try with this A1: (2+3)*4, B1: ="="&A1, but what I got was, B1: =(2+3)*4 and not the result althoug the cell is formated as number.
I try too, de function Value(), but it doesn't work.
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: operation in one cell and result in another one

Post by Villeroy »

No, this can not work. There is no function for evaluation of strings. Use scenarios for exchanging calculation models.
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
User avatar
Hagar Delest
Moderator
Posts: 32668
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: operation in one cell and result in another one

Post by Hagar Delest »

Just a proposal.
A1: 3
B1: 4
C1: 2
A2: ="("&A1&"+"&B1&")*"&C1
B2: =(A1+B1)*C1

Thanks to add '[Solved]' at beginning of your first post title (edit button) if your issue has been fixed.
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
IL CAPO
Posts: 5
Joined: Wed May 07, 2008 12:05 am

Re: operation in one cell and result in another one

Post by IL CAPO »

In Excel I use a User Defined Function, like this, but I do not known the translation for Open Office, do you?

Function Total(contenido As String)
Dim K As Integer
Dim L As Double
On Error GoTo fin
For K = 1 To Len(contenido)
If Mid(contenido, K, 1) = "," Then Mid(contenido, K, 1) = "."
Next

L = Evaluate(contenido)
If L = Error Then Total = "" Else Total = L
fin:
End Function


Thank you
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: operation in one cell and result in another one

Post by Villeroy »

It is impossible to do this since there is no built-in equivalent to function "evaluate".
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
Dave
Posts: 1011
Joined: Sun Dec 23, 2007 6:53 pm

Re: operation in one cell and result in another one

Post by Dave »

This question has arisen a couple of times. The answer is simply "No. It can't be done." So far as I know, it requires "parsing" the "text" content of a cell, and that is a low-level programming responsibility. My question remains: "Why do it"? What is the advantage?

David.
IL CAPO
Posts: 5
Joined: Wed May 07, 2008 12:05 am

Re: operation in one cell and result in another one

Post by IL CAPO »

When you have to calculate the cost of a building or of a task, you have to make the computation, you need to have the operation first an then get the result. It is very important to control this values, If you can see the operation, anyone can control it, and then beside you achieved the wright value.
In Qpro I get this simply with de Value() function of the operation without the (=) sign, in Excel y can get it with the function I said before, in OOoffice ???
User avatar
keme
Volunteer
Posts: 3705
Joined: Wed Nov 28, 2007 10:27 am
Location: Egersund, Norway

Re: operation in one cell and result in another one

Post by keme »

Can you use the reverse, then? The function FORMULA() returns the formula entered in a cell as text. That should provide opportunity for visual inspection of the formula.
Apache OO 4.1.12 and LibreOffice 7.5, mostly on Ms Windows 10
User avatar
kingfisher
Volunteer
Posts: 2123
Joined: Tue Nov 20, 2007 10:53 am

Re: operation in one cell and result in another one

Post by kingfisher »

What about doing it the other way around? Put the calculation in B1, which will display the result and in A1 =FORMULA(B1) which will show the formula you have in B1.
Apache OpenOffice 4.1.9 on Linux
IL CAPO
Posts: 5
Joined: Wed May 07, 2008 12:05 am

Re: operation in one cell and result in another one

Post by IL CAPO »

It is a very good choice, I believe that this can work. I am going to try it.
Thank you very much
Dave
Posts: 1011
Joined: Sun Dec 23, 2007 6:53 pm

Re: operation in one cell and result in another one

Post by Dave »

You can also easily get rid of the "=" sign through string manipulations if you wish.

David.
Post Reply