[Solved] Spreadsheet cells as MATH variables?

Discuss the formula editor
Post Reply
gritsman
Posts: 4
Joined: Mon Feb 23, 2015 3:43 am

[Solved] Spreadsheet cells as MATH variables?

Post by gritsman »

ETA: not exactly the answer I was looking for but it can be used to get the results needed. Hope this is useful for anyone else searching for the same thing.

I've done a bit of hunting and can not seem to find if this is possible so thought I would inquire here.
I want to call a CALC cell as a variable in a MATH equation.
For example (referencing the basic tutorial example)
<?> times <?>
I want the <?> to reference a CALC cell versus having to type an integer.
Is this possible?
I don't really care that MATH will not properly solve whatever is shown (that is what CALC is for) but I want it to the show the formulas properly written.
Thank to any and all who can point me in the right direction.
Nate
Last edited by gritsman on Wed Feb 25, 2015 3:19 am, edited 1 time in total.
OpenOffice 4.1.0 on Windows 7
User avatar
MrProgrammer
Moderator
Posts: 5099
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: Spreadsheet cells as MATH variables?

Post by MrProgrammer »

Hi, and welcome to the forum.

The Math (or Formula) component of Open Office changes text like "3 times 4" into "3 × 4". If you have a spreadsheet with 3 in A1 and 4 in B1, you can use the spreadsheet formula =A1&" times "&B1 in a cell to create the text "3 times 4". Copy that cell's content and paste it into the formula entry window.

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, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
gritsman
Posts: 4
Joined: Mon Feb 23, 2015 3:43 am

Re: Spreadsheet cells as MATH variables?

Post by gritsman »

That sounds like exactly what i'm looking for.
What is the symbol after A1 and before B1? Is it an ampersand?
Thank you so much. I figured it was a formatting issue. I just couldn't find the answer elsewhere. Of course that may be my lack of proper terminology.

ETA: that format (and it was an ampersand) did not work. I tried many derivation around it too that didn't seem to work. "=A1&", &A1&, =&A1. I'm still trying other as I feel its a formatting issue.
OpenOffice 4.1.0 on Windows 7
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Spreadsheet cells as MATH variables?

Post by acknak »

We might be able to make some specific suggestions if you could tell us what you're trying to accomplish with the sheet.

Are you trying to do some calculations, to get the answer? Maybe for teaching arithmetic? Something else?

Here's a sample sheet that shows the four basic arithmetic operations, where you can see the problem displayed as usual, enter any numbers, and see the answer calculated automatically.
Attachments
arithmetic.ods
(8.46 KiB) Downloaded 489 times
AOO4/LO5 • Linux • Fedora 23
gritsman
Posts: 4
Joined: Mon Feb 23, 2015 3:43 am

Re: Spreadsheet cells as MATH variables?

Post by gritsman »

Sure.
I'm trying to develop an engineering calculation sheet.
For example:
M = w(omega) * L^2 / 8
Then have another line where the appropriate values of w and l are shown in the equation.
then on the next line M = <the final value>
so
Cell A1: =1.0 (w)
Cell B1: =20 (L)
Cell C1: = A1*B1^2/8
the Math funcions would appear as
M = {%omega times L^2] over 8
next line
[<cell A1> times <cell B1>^2] over 8
next line
M = <cell C1>
As I mentioned, Math doesn't need to actually do the calculations. I just want it for the appearance. I'd like to tie it to a spreadsheet for ease of repetition.
Thanks for your input and time.
OpenOffice 4.1.0 on Windows 7
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Spreadsheet cells as MATH variables?

Post by acknak »

Right. Well, it would be nice if OO Math could be tied into Calc cells like this, but it's not possible without some programming (I have no idea how difficult it would be; I'm just assuming that it's possible).
AOO4/LO5 • Linux • Fedora 23
User avatar
MrProgrammer
Moderator
Posts: 5099
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: Spreadsheet cells as MATH variables?

Post by MrProgrammer »

MrProgrammer wrote:=A1&" times "&B1
gritsman wrote:That format (and it was an ampersand) did not work.
It works for me. See attachment, sheet Times, cell D1. The Math Formula object is embedded in the spreadsheet with Insert → Object → Formula. Normally, I would create it as a separate file (File → New → Formula). It's easier to send everything to you in one file.
gritsman wrote:I'm trying to develop an engineering calculation sheet: M = Omega * L^2 / 8 …
See attachment, sheet Engineering. Use Insert → Names → Define to view definitions.

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.
gritsman wrote:What is the symbol after A1 and before B1? Is it an ampersand? I tried … "=A1&", &A1&, =&A1.
That question and your attempt at a formula suggest that you have not used spreadsheets much. Read [Tutorial] Ten concepts that every Calc user should know.
Attachments
201502241113.ods
(15.93 KiB) Downloaded 462 times
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.7, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
gritsman
Posts: 4
Joined: Mon Feb 23, 2015 3:43 am

Re: Spreadsheet cells as MATH variables?

Post by gritsman »

I do not claim to be an calc guru. If I were, why would I be here? I'll check out your link. I do use spreadsheets frequently and I've never defined a formula as another cell. That seems kind of redundant. Why not just make the cell with the original formula functional. But I'm sure there is a purpose or it wouldn't be an option.
Anyway, I reread your original post and see now what you did. Unfortunately, your solution does not update the math forumla so I would basically have to recreate the formula with each design. Maybe it's a workable solution since it is pretty much cut and paste. Just not as straightforward as I was hoping for.
Thank you.
OpenOffice 4.1.0 on Windows 7
Post Reply