Calc formula ...

classic Classic list List threaded Threaded
10 messages Options
zed zed
Reply | Threaded
Open this post in threaded view
|

Calc formula ...

Using LinuxMint v17.1 Rebecca with MATE DE and LibreOffic v4.2.7.2 Build
ID 420M0(Build2)

I have a three column spreadsheet.

Column A. Date - The dates are consecutive

Column B. Production - The Production has a daily target of 10,000 units
and each production period is of seven days.

Column C. a formula every seventh cell.

Is it possible to construct a formula which will show in the seventh cell
of column C the average for the number of days  of production i.e. if day
1 reaches a production of 10,000 units I want this figure entered into the
seventh cell in column C.  If days 1+2+3+4 total, say, 42,500 I want the
seventh cell in column C to show the average of 10,265.  In other words I
want the average shown for the actual days of production each seven day
period.

DL

--
David Love
Can atheists get insurance for acts of God?

--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

steveedmonds steveedmonds
Reply | Threaded
Open this post in threaded view
|

Re: Calc formula ...

Hi.
Yes it is. May some clarification though.
Is it the prior 7 days like a rolling average or the days say Monday to
Sunday, every Sunday.
Are you only averaging days where production exceeds 10000, so in your
1st example day 1 is the only day exceeding 10000 so the average=10000
and in your second example 4 days exceed 10000 so those 4 are averaged.
Steve
On 2015-03-10 19:20, David Love wrote:

> Using LinuxMint v17.1 Rebecca with MATE DE and LibreOffic v4.2.7.2 Build
> ID 420M0(Build2)
>
> I have a three column spreadsheet.
>
> Column A. Date - The dates are consecutive
>
> Column B. Production - The Production has a daily target of 10,000 units
> and each production period is of seven days.
>
> Column C. a formula every seventh cell.
>
> Is it possible to construct a formula which will show in the seventh cell
> of column C the average for the number of days  of production i.e. if day
> 1 reaches a production of 10,000 units I want this figure entered into the
> seventh cell in column C.  If days 1+2+3+4 total, say, 42,500 I want the
> seventh cell in column C to show the average of 10,265.  In other words I
> want the average shown for the actual days of production each seven day
> period.
>
> DL
>


--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Brian Barker Brian Barker
Reply | Threaded
Open this post in threaded view
|

Re: Calc formula ...

In reply to this post by zed
At 19:20 10/03/2015 +1300, David Love wrote:

>I have a three column spreadsheet.
>Column A. Date - The dates are consecutive
>Column B. Production - The Production has a daily target of 10,000
>units and each production period is of seven days.
>Column C. a formula every seventh cell.
>
>Is it possible to construct a formula which will show in the seventh
>cell of column C the average for the number of days of production
>i.e. if day 1 reaches a production of 10,000 units I want this
>figure entered into the seventh cell in column C.

Hold on! How do you know this is going to be the average for the
week? Do your workers celebrate reaching the daily target and take
the rest of the week off? Surely they need to attempt the same daily
target on each of the next six days? Or do you mean that 10000 is the
*weekly* target? If so, what happens when it is reached? Does
production automatically stop to prevent its being exceeded? Or could
some weeks exceed 10000 - even by accident?

>If days 1+2+3+4 total, say, 42,500 I want the seventh cell in column
>C to show the average of 10,265. In other words I want the average
>shown for the actual days of production each seven day period.

So 10000 isn't a weekly limit. In that case, what is the significance
of the 10000? If four days exceed 10000, as here, it's not a daily
limit either: at least one of these days must have exceeded 10000.
I'm beginning to suspect that it has no significance for the
calculation (so you didn't need to tell us): it may be of interest
only to the workers' supervisor in interpreting the results.

You can find the average of non-negative values (i.e. non-zero values
in your case, assuming production cannot be negative) by putting in, say, C7:
=AVERAGEIF(B1:B7;">0")
If you copy this and paste it into every seventh row of column C, you
will have what you need.

But that leaves you with the rather messy requirement to paste
separately into every seventh row - a process very prone to error.
Instead, in C7 try:
=IF(MOD(ROW();7)=0;AVERAGEIF(B1:B7;">0");"")
ROW() returns the current row number. The MOD() function returns the
remainder on dividing by 7. If this is zero - as it will be for row 7
and every seventh row thereafter - the required average is shown;
otherwise the null string ensures that there is no display in the
cell. You can copy or fill this down column C without the same risk
of error as the previous suggestion. Note that comparing the result
of the MOD() function with zero will show results in rows 7, 14, 21,
and so on. You will have to change the "0" to "1" to show results
instead in rows 8, 15, 22, and so on - and similarly for other
possibilities. Once you have found the appropriate value, you can
fill the formula containing it down the column.

Is it possible for there to be no production at all in a particular
week? The above formula, in evaluating the average of no values,
attempts to divide by zero and displays #DIV/0! . You could test for
this and avoid it in various ways. If days with no production have
empty cells in column B,
=IF(AND(COUNT(B1:B7)>0;MOD(ROW();7)=0);AVERAGEIF(B1:B7;">0");"")
would suffice. If they have (or may have) explicit zero values, try:
=IF(AND(COUNTIF(B1:B7;">0")>0;MOD(ROW();7)=0);AVERAGEIF(B1:B7;">0");"")

I trust this helps.

Brian Barker


--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

steveedmonds steveedmonds
Reply | Threaded
Open this post in threaded view
|

Re: Calc formula ...

In reply to this post by zed
Ok. OP has stated "each production period is of seven days" so answers
my first question.
On 2015-03-10 19:20, David Love wrote:

> Using LinuxMint v17.1 Rebecca with MATE DE and LibreOffic v4.2.7.2 Build
> ID 420M0(Build2)
>
> I have a three column spreadsheet.
>
> Column A. Date - The dates are consecutive
>
> Column B. Production - The Production has a daily target of 10,000 units
> and each production period is of seven days.
>
> Column C. a formula every seventh cell.
>
> Is it possible to construct a formula which will show in the seventh cell
> of column C the average for the number of days  of production i.e. if day
> 1 reaches a production of 10,000 units I want this figure entered into the
> seventh cell in column C.  If days 1+2+3+4 total, say, 42,500 I want the
> seventh cell in column C to show the average of 10,265.  In other words I
> want the average shown for the actual days of production each seven day
> period.
>
> DL
>


--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Carl Paulsen Carl Paulsen
Reply | Threaded
Open this post in threaded view
|

Re: Calc formula ...

In reply to this post by Brian Barker
Wow, excellent suggestions Brian.  Your ideas are always spot on. Thanks.
Carl


On 3/10/15 4:08 AM, Brian Barker wrote:

> At 19:20 10/03/2015 +1300, David Love wrote:
>> I have a three column spreadsheet.
>> Column A. Date - The dates are consecutive
>> Column B. Production - The Production has a daily target of 10,000
>> units and each production period is of seven days.
>> Column C. a formula every seventh cell.
>>
>> Is it possible to construct a formula which will show in the seventh
>> cell of column C the average for the number of days of production
>> i.e. if day 1 reaches a production of 10,000 units I want this figure
>> entered into the seventh cell in column C.
>
> Hold on! How do you know this is going to be the average for the week?
> Do your workers celebrate reaching the daily target and take the rest
> of the week off? Surely they need to attempt the same daily target on
> each of the next six days? Or do you mean that 10000 is the *weekly*
> target? If so, what happens when it is reached? Does production
> automatically stop to prevent its being exceeded? Or could some weeks
> exceed 10000 - even by accident?
>
>> If days 1+2+3+4 total, say, 42,500 I want the seventh cell in column
>> C to show the average of 10,265. In other words I want the average
>> shown for the actual days of production each seven day period.
>
> So 10000 isn't a weekly limit. In that case, what is the significance
> of the 10000? If four days exceed 10000, as here, it's not a daily
> limit either: at least one of these days must have exceeded 10000. I'm
> beginning to suspect that it has no significance for the calculation
> (so you didn't need to tell us): it may be of interest only to the
> workers' supervisor in interpreting the results.
>
> You can find the average of non-negative values (i.e. non-zero values
> in your case, assuming production cannot be negative) by putting in,
> say, C7:
> =AVERAGEIF(B1:B7;">0")
> If you copy this and paste it into every seventh row of column C, you
> will have what you need.
>
> But that leaves you with the rather messy requirement to paste
> separately into every seventh row - a process very prone to error.
> Instead, in C7 try:
> =IF(MOD(ROW();7)=0;AVERAGEIF(B1:B7;">0");"")
> ROW() returns the current row number. The MOD() function returns the
> remainder on dividing by 7. If this is zero - as it will be for row 7
> and every seventh row thereafter - the required average is shown;
> otherwise the null string ensures that there is no display in the
> cell. You can copy or fill this down column C without the same risk of
> error as the previous suggestion. Note that comparing the result of
> the MOD() function with zero will show results in rows 7, 14, 21, and
> so on. You will have to change the "0" to "1" to show results instead
> in rows 8, 15, 22, and so on - and similarly for other possibilities.
> Once you have found the appropriate value, you can fill the formula
> containing it down the column.
>
> Is it possible for there to be no production at all in a particular
> week? The above formula, in evaluating the average of no values,
> attempts to divide by zero and displays #DIV/0! . You could test for
> this and avoid it in various ways. If days with no production have
> empty cells in column B,
> =IF(AND(COUNT(B1:B7)>0;MOD(ROW();7)=0);AVERAGEIF(B1:B7;">0");"")
> would suffice. If they have (or may have) explicit zero values, try:
> =IF(AND(COUNTIF(B1:B7;">0")>0;MOD(ROW();7)=0);AVERAGEIF(B1:B7;">0");"")
>
> I trust this helps.
>
> Brian Barker
>
>

--

Carl Paulsen

8 Hamilton Street

Dover, NH 03820

(603) 749-2310


--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Johnny Rosenberg Johnny Rosenberg
Reply | Threaded
Open this post in threaded view
|

Fwd: [libreoffice-users] Calc formula ...

Sorry, I accidently sent my reply to the very wrong place…

---------- Forwarded message ----------
From: Johnny Rosenberg <[hidden email]>
Date: 2015-03-10 19:26 GMT+01:00
Subject: Re: [libreoffice-users] Calc formula ...
To: [hidden email]


Another idea would probably be to first enter the first formula on the
seventh row, then the following formulas could check if the seventh cell
above is a formula…
For instance, the first formula in C7, than in C8:
=if(isformula(C1);average(B2:B8);"")
That cell could then be copied down as far as needed.

Something like that…



Kind regards

Johnny Rosenberg
ジョニー・ローゼンバーグ


2015-03-10 12:49 GMT+01:00 Carl Paulsen <[hidden email]>:

> Wow, excellent suggestions Brian.  Your ideas are always spot on. Thanks.
> Carl
>
>
> On 3/10/15 4:08 AM, Brian Barker wrote:
>
>> At 19:20 10/03/2015 +1300, David Love wrote:
>>
>>> I have a three column spreadsheet.
>>> Column A. Date - The dates are consecutive
>>> Column B. Production - The Production has a daily target of 10,000 units
>>> and each production period is of seven days.
>>> Column C. a formula every seventh cell.
>>>
>>> Is it possible to construct a formula which will show in the seventh
>>> cell of column C the average for the number of days of production i.e. if
>>> day 1 reaches a production of 10,000 units I want this figure entered into
>>> the seventh cell in column C.
>>>
>>
>> Hold on! How do you know this is going to be the average for the week? Do
>> your workers celebrate reaching the daily target and take the rest of the
>> week off? Surely they need to attempt the same daily target on each of the
>> next six days? Or do you mean that 10000 is the *weekly* target? If so,
>> what happens when it is reached? Does production automatically stop to
>> prevent its being exceeded? Or could some weeks exceed 10000 - even by
>> accident?
>>
>>  If days 1+2+3+4 total, say, 42,500 I want the seventh cell in column C
>>> to show the average of 10,265. In other words I want the average shown for
>>> the actual days of production each seven day period.
>>>
>>
>> So 10000 isn't a weekly limit. In that case, what is the significance of
>> the 10000? If four days exceed 10000, as here, it's not a daily limit
>> either: at least one of these days must have exceeded 10000. I'm beginning
>> to suspect that it has no significance for the calculation (so you didn't
>> need to tell us): it may be of interest only to the workers' supervisor in
>> interpreting the results.
>>
>> You can find the average of non-negative values (i.e. non-zero values in
>> your case, assuming production cannot be negative) by putting in, say, C7:
>> =AVERAGEIF(B1:B7;">0")
>> If you copy this and paste it into every seventh row of column C, you
>> will have what you need.
>>
>> But that leaves you with the rather messy requirement to paste separately
>> into every seventh row - a process very prone to error. Instead, in C7 try:
>> =IF(MOD(ROW();7)=0;AVERAGEIF(B1:B7;">0");"")
>> ROW() returns the current row number. The MOD() function returns the
>> remainder on dividing by 7. If this is zero - as it will be for row 7 and
>> every seventh row thereafter - the required average is shown; otherwise the
>> null string ensures that there is no display in the cell. You can copy or
>> fill this down column C without the same risk of error as the previous
>> suggestion. Note that comparing the result of the MOD() function with zero
>> will show results in rows 7, 14, 21, and so on. You will have to change the
>> "0" to "1" to show results instead in rows 8, 15, 22, and so on - and
>> similarly for other possibilities. Once you have found the appropriate
>> value, you can fill the formula containing it down the column.
>>
>> Is it possible for there to be no production at all in a particular week?
>> The above formula, in evaluating the average of no values, attempts to
>> divide by zero and displays #DIV/0! . You could test for this and avoid it
>> in various ways. If days with no production have empty cells in column B,
>> =IF(AND(COUNT(B1:B7)>0;MOD(ROW();7)=0);AVERAGEIF(B1:B7;">0");"")
>> would suffice. If they have (or may have) explicit zero values, try:
>> =IF(AND(COUNTIF(B1:B7;">0")>0;MOD(ROW();7)=0);AVERAGEIF(B1:B7;">0");"")
>>
>> I trust this helps.
>>
>> Brian Barker
>>
>>
>>
> --
>
> Carl Paulsen
>
> 8 Hamilton Street
>
> Dover, NH 03820
>
> (603) 749-2310
>
>
>
> --
> To unsubscribe e-mail to: [hidden email]
> Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-
> unsubscribe/
> Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
> List archive: http://listarchives.libreoffice.org/global/users/
> All messages sent to this list will be publicly archived and cannot be
> deleted
>
>

--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
zed zed
Reply | Threaded
Open this post in threaded view
|

Re: Calc formula ...

In reply to this post by zed
David Love <[hidden email]> wrote:

> Using LinuxMint v17.1 Rebecca with MATE DE and LibreOffic v4.2.7.2 Build
> ID 420M0(Build2)
>
> I have a three column spreadsheet.
>
> Column A. Date - The dates are consecutive
>
> Column B. Production - The Production has a daily target of 10,000 units
> and each production period is of seven days.
>
> Column C. a formula every seventh cell.
>
> Is it possible to construct a formula which will show in the seventh
> cell of column C the average for the number of days  of production i.e.
> if day 1 reaches a production of 10,000 units I want this figure entered
> into the seventh cell in column C.  If days 1+2+3+4 total, say, 42,500 I
> want the seventh cell in column C to show the average of 10,265.  In
> other words I want the average shown for the actual days of production
> each seven day period.

Thank you Steve, Brian and Johnny for your prompt replies.  I will work
through the suggestions and report back.

I should, however, make a confession :-)  I used the word "Production" as
I wanted members to see this as a "business" rather than a "personal"
question.

In reality, Column A is the numbers of steps I take each day. Ten thousand
is considered to be the number necessary to keep healthy.

What I want, in simple terms, is to determine the average number of steps
I am taking every week.

Hopefully, this explanation will answer the questions reaided.

DL
--
David Love
Bachelor: A guy who has cheated a woman out of a divorce.  

--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Brian Barker Brian Barker
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: [libreoffice-users] Calc formula ...

In reply to this post by Johnny Rosenberg
At 19:27 10/03/2015 +0100, Johnny Rosenberg wrote:
>Another idea would probably be to first enter
>the first formula on the seventh row, then the
>following formulas could check if the seventh
>cell above is a formula… For instance, the first
>formula in C7, than in C8:
>=if(isformula(C1);average(B2:B8);"") That cell
>could then be copied down as far as needed.

Er, not really! Yes: that will work fine up to a
point, displaying nothing in C8 to C13 and the
required value in C14. But from C15 onwards, the
formula is always referring back to a cell which
*does* contain a formula, albeit one which
displays nothing in the cell. From C14 onwards,
the formula is identical to =AVERAGE(Bx:By) .

But you could do something very similar with C8 having:
=IF(C1<>"";AVERAGE(B2:B8);"") .

Brian Barker  


--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Brian Barker Brian Barker
Reply | Threaded
Open this post in threaded view
|

Re: Calc formula ...

In reply to this post by zed
At 10:28 11/03/2015 +1300, David Love wrote:
>What I want, in simple terms, is to determine the average number of
>steps I am taking every week. Hopefully, this explanation will
>answer the questions reaided.

Not really!

I think you've confirmed that the 10000 figure is irrelevant in the
calculation. But your earlier statements that "if day 1 reaches a
production of 10,000 units I want this figure entered" and "If days
1+2+3+4 total, say, 42,500 I want ... to show the average of 10,265"
both indicate that the required result does not depend on other daily
values. These contradict the idea that you simply want the true
average of all seven values.

Unsurprisingly, you can calculate averages using the AVERAGE() function.

Incidentally, doesn't all this cry out for a table instead of a list?
Put a week date (or date range) in column A, as you suggest. Enter
your data for the days of that week in columns B to H of the same
row. It's then particularly simple to calculate averages in column I.
At the bottom of the columns, you could calculate averages for each
weekday - and perhaps discover that you need to be more active on Thursdays!

Brian Barker  


--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

zed zed
Reply | Threaded
Open this post in threaded view
|

Re: Calc formula ...

Brian Barker <[hidden email]> wrote:

> At 10:28 11/03/2015 +1300, David Love wrote:
> > What I want, in simple terms, is to determine the average number of
> > steps I am taking every week. Hopefully, this explanation will answer
> > the questions reaided.
>
> Not really!
>
> I think you've confirmed that the 10000 figure is irrelevant in the
> calculation. But your earlier statements that "if day 1 reaches a
> production of 10,000 units I want this figure entered" and "If days
> 1+2+3+4 total, say, 42,500 I want ... to show the average of 10,265"
> both indicate that the required result does not depend on other daily
> values. These contradict the idea that you simply want the true average
> of all seven values.
>
> Unsurprisingly, you can calculate averages using the AVERAGE() function.
>
> Incidentally, doesn't all this cry out for a table instead of a list?
> Put a week date (or date range) in column A, as you suggest. Enter your
> data for the days of that week in columns B to H of the same row. It's
> then particularly simple to calculate averages in column I. At the
> bottom of the columns, you could calculate averages for each weekday -
> and perhaps discover that you need to be more active on Thursdays!

Ha!  I constructed a table, as you suggested and, yes, it does meet my
requirements.

Thanks for the suggestion, Brian.

David

--
David Love
Dogs wag their tail with their whole heart.

--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted