Is there a better way?

Discuss the spreadsheet application
Post Reply
Robindude
Posts: 10
Joined: Sun Oct 06, 2013 11:43 pm

Is there a better way?

Post by Robindude »

Last time I got pointed to LookUp. This... likely won't do it.

((A4^A$3)*A$2)+((B4^B$3)*B$2)+...

Is there a way to avoid writing this all out, but still leave the row with an unspecified number of entries since more might be added?
Open Office 4.0 on Win 7
User avatar
RusselB
Moderator
Posts: 6646
Joined: Fri Jan 03, 2014 7:31 am
Location: Sarnia, ON

Re: Is there a better way?

Post by RusselB »

A partial formula like that is next to useless.
If you can't provide a full formula that shows what you are trying to do, even if the formula doesn't work, then we need an explanation as to what it is you are trying to do.
Based on what I can see, my first guess is that you want to put row 4 to the exponent row 3, then multiply that by row 2 for an unknown (possibly variable) number of columns.
If that is correct, then I can't (at the moment) think of another way of doing it, except for writing it all out. Fortunately if you do have to write it all out, any entries in row 2, 3, or 4 that are 0 will calculate to a 0 for the summation.
OpenOffice 4.1.7, LibreOffice 7.0.1.2 on Windows 7 Pro, Ultimate & Windows 10 Home (2004)
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Is there a better way?

Post by acknak »

Robindude wrote:Is there a way to avoid writing this all out, but still leave the row with an unspecified number of entries since more might be added?
Sorry, I'm not sure I understand what you're looking for.

Maybe something like this:
=SUMPRODUCT((A4:E4^A3:E3)*A2:E2)

That will calculate the sum of the terms in columns A to E; empty columns will evaluate to zero so they are effectively ignored. You can change the formula to allow for a larger number of terms but it won't adjust as you fill in the cells.
AOO4/LO5 • Linux • Fedora 23
User avatar
Zizi64
Volunteer
Posts: 11362
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Is there a better way?

Post by Zizi64 »

Last time I got pointed to LookUp. This... likely won't do it.

((A4^A$3)*A$2)+((B4^B$3)*B$2)+...

Is there a way to avoid writing this all out, but still leave the row with an unspecified number of entries since more might be added?
Please upload your ODF type example file here.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
morchat
Posts: 49
Joined: Wed Dec 26, 2012 6:13 pm
Location: Poland

Re: Is there a better way?

Post by morchat »

Use CSE formulas:

Code: Select all

=SUM(A4:G4^A3:G3*A2:G2)
If you give names to areas, use them, eg:

Code: Select all

=SUM(area1^area2*area3)
The CSE formula will be created after the CTRL+SHIFT+ENTER
Expansion you do not need to enclose in parentheses. The order of calculations is: exponentiation, multiplication and division, addition and subtraction
AOO 4.1.7, LibreOffice 6.2.8
Windows 10 64 bits
Post Reply