If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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 |
#2
|
|||
|
|||
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:Z11) ,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 |
#3
|
|||
|
|||
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 |
#4
|
|||
|
|||
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 |
Thread Tools | |
Display Modes | |
|
|