ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How do I add consecutive numbers but start over at break in the. (https://www.excelbanter.com/excel-discussion-misc-queries/2528-how-do-i-add-consecutive-numbers-but-start-over-break.html)

FLKULCHAR

How do I add consecutive numbers but start over at break in the.
 
Recently, the following question was posed by another party:

"How do I add consecutive numbers but start over at a break in them. I'm
trying to calculate consecutive days of attendance. One might have had 20
days in a row missed one and then I need to start over."

The rsvp was:

You received an answer...

In B1 enter:
=--(A10)

In B2 enter:
=(A20)*(1+B1)

and drag down to copy as needed

My question is:

What does =--(A10) mean?

i.e. what is the meaning of...=-- ??

Regards,

FL KULCHAR



JE McGimpsey

Take a look he

http://www.mcgimpsey.com/excel/doubleneg.html

In article ,
FLKULCHAR wrote:

what is the meaning of...=--


Earl Kiosterud

FL,

What does =--(A10) mean?


First of all, the expression A10 is a boolean expression. A1 is either
greater than 0, or it isn't. So the expression resolves to TRUE or FALSE.
If you select this part of the formula and press F9, it will evaluate it for
you, putting in TRUE or FALSE. Press Esc, not Enter, to keep the formula
from being permanently changed.

If we want 0 instead of FALSE, or 1 instead of TRUE, we use --, double
negation, which forces Excel to treat the (A10) expression as a number. We
say it coerces it from it's current data type (boolean) to a number. The
second - did that (the one directly in front of the (A10) expression), and
the first brought it back to the original sign, + or -. You can get the
same result with =(A10)+0. It has to coerce the (A10) to numeric before
it can add the zero. Or =(A10)*1. The double negation is probably the
most universally used and recognized.

The parentheses are necessary because the rules of precedence would
otherwise cause the -- (actually only the second one) to apply only to the
A1 term, instead of the expression A10.
--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"FLKULCHAR" wrote in message
...
Recently, the following question was posed by another party:

"How do I add consecutive numbers but start over at a break in them. I'm
trying to calculate consecutive days of attendance. One might have had 20
days in a row missed one and then I need to start over."

The rsvp was:

You received an answer...

In B1 enter:
=--(A10)

In B2 enter:
=(A20)*(1+B1)

and drag down to copy as needed

My question is:

What does =--(A10) mean?

i.e. what is the meaning of...=-- ??

Regards,

FL KULCHAR





FLKULCHAR

To Earl:

Thank you for your RSVP: your eloquence and your illustrious knowledge
certainly answered my question...THANK YOU VERY MUCH.

--FL Kulchar*1

"Earl Kiosterud" wrote:

FL,

What does =--(A10) mean?


First of all, the expression A10 is a boolean expression. A1 is either
greater than 0, or it isn't. So the expression resolves to TRUE or FALSE.
If you select this part of the formula and press F9, it will evaluate it for
you, putting in TRUE or FALSE. Press Esc, not Enter, to keep the formula
from being permanently changed.

If we want 0 instead of FALSE, or 1 instead of TRUE, we use --, double
negation, which forces Excel to treat the (A10) expression as a number. We
say it coerces it from it's current data type (boolean) to a number. The
second - did that (the one directly in front of the (A10) expression), and
the first brought it back to the original sign, + or -. You can get the
same result with =(A10)+0. It has to coerce the (A10) to numeric before
it can add the zero. Or =(A10)*1. The double negation is probably the
most universally used and recognized.

The parentheses are necessary because the rules of precedence would
otherwise cause the -- (actually only the second one) to apply only to the
A1 term, instead of the expression A10.
--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"FLKULCHAR" wrote in message
...
Recently, the following question was posed by another party:

"How do I add consecutive numbers but start over at a break in them. I'm
trying to calculate consecutive days of attendance. One might have had 20
days in a row missed one and then I need to start over."

The rsvp was:

You received an answer...

In B1 enter:
=--(A10)

In B2 enter:
=(A20)*(1+B1)

and drag down to copy as needed

My question is:

What does =--(A10) mean?

i.e. what is the meaning of...=-- ??

Regards,

FL KULCHAR







All times are GMT +1. The time now is 02:16 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com