ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   ME, STRANGE SUMMATION (https://www.excelbanter.com/excel-worksheet-functions/200898-me-strange-summation.html)

Berj

ME, STRANGE SUMMATION
 
Hi,

I can have the number 1 in several cells in a range of cells A1 to Z1, but
it is always filled starting from cell A1 and gradually to the right. May
also skip some cells.
Ex.
A1 to C1 may be blank, D1 is 1, then E1 to J1 is blank, then K1 is 1, and so
on.
I need a formula which adds up these 1s to the last position where a 1 is
found.

Summing up the cells till Z1 is not an option, since later, in another
formula I will find the sum of all the 1s AFTER the last 1 which was summed
up in the first formula.
This second formula will be relatively easy after I get the first formula.

I hope this was well understood.

Thanks in advance guys.
Berj


Bob Phillips[_3_]

ME, STRANGE SUMMATION
 
I am not sure I get why, but try this array formula

=SUM(A1:INDEX(A1:Z1,,MIN(IF((A1:Z1<"")*(A1:Z1<1) ,COLUMN(A1:Z1)))-1))

--
__________________________________
HTH

Bob

"Berj" wrote in message
...
Hi,

I can have the number 1 in several cells in a range of cells A1 to Z1, but
it is always filled starting from cell A1 and gradually to the right. May
also skip some cells.
Ex.
A1 to C1 may be blank, D1 is 1, then E1 to J1 is blank, then K1 is 1, and
so
on.
I need a formula which adds up these 1s to the last position where a 1 is
found.

Summing up the cells till Z1 is not an option, since later, in another
formula I will find the sum of all the 1s AFTER the last 1 which was
summed
up in the first formula.
This second formula will be relatively easy after I get the first formula.

I hope this was well understood.

Thanks in advance guys.
Berj




RagDyeR

ME, STRANGE SUMMATION
 
Try this:

=SUM(A1:INDEX(A1:Z1,MATCH(99^99,A1:Z1)))

This totals to the last numeric cell.

Same result as
=Sum(A1:Z1)

Care to share your reason why the simple Sum formula does not work for you?
--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Berj" wrote in message
...
Hi,

I can have the number 1 in several cells in a range of cells A1 to Z1, but
it is always filled starting from cell A1 and gradually to the right. May
also skip some cells.
Ex.
A1 to C1 may be blank, D1 is 1, then E1 to J1 is blank, then K1 is 1, and

so
on.
I need a formula which adds up these 1s to the last position where a 1 is
found.

Summing up the cells till Z1 is not an option, since later, in another
formula I will find the sum of all the 1s AFTER the last 1 which was

summed
up in the first formula.
This second formula will be relatively easy after I get the first formula.

I hope this was well understood.

Thanks in advance guys.
Berj



Teethless mama

ME, STRANGE SUMMATION
 
=SUM(1:1)


"Berj" wrote:

Hi,

I can have the number 1 in several cells in a range of cells A1 to Z1, but
it is always filled starting from cell A1 and gradually to the right. May
also skip some cells.
Ex.
A1 to C1 may be blank, D1 is 1, then E1 to J1 is blank, then K1 is 1, and so
on.
I need a formula which adds up these 1s to the last position where a 1 is
found.

Summing up the cells till Z1 is not an option, since later, in another
formula I will find the sum of all the 1s AFTER the last 1 which was summed
up in the first formula.
This second formula will be relatively easy after I get the first formula.

I hope this was well understood.

Thanks in advance guys.
Berj



All times are GMT +1. The time now is 05:36 PM.

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