ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Sum of data (https://www.excelbanter.com/excel-discussion-misc-queries/221114-sum-data.html)

TFMR

Sum of data
 
Dear All,

I have column with numeric data, I want the sum when value 0 come in column
then next sum until the value is 0.

Thnx & Regards

Shane Devenshire[_2_]

Sum of data
 
Hi,

It would be nice to see a sample of the data with what you want as the result.

Possible if your data is in column A and the 0's are in column B

=SUMIF(B1:B100,0,A1:A100)

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire

"TFMR" wrote:

Dear All,

I have column with numeric data, I want the sum when value 0 come in column
then next sum until the value is 0.

Thnx & Regards


Chris Bode via OfficeKB.com

Sum of data
 
Here, I offer you a solution with macro
1.Right click toolbarselect control box
2.From the control box that appears on the screen select a command button and
draw it on your sheet
3.Double click the command button to open the code window and paste following
codes
#
Private Sub Command1_Click()
Dim row As Integer, col As Integer
row = 1
col = 1

Dim sum As Double
Dim x As Double
sum = 0
While Sheet1.Cells(row, col).Value < ""
x = Val(Sheet1.Cells(row, col).Value)
sum = sum + x

If (Val(Sheet1.Cells(row, col).Value) = 0) Then
Sheet1.Rows(row).Insert
row = row + 1

Sheet1.Cells(row - 1, col).Value = sum
sum = 0

End If

row = row + 1
Wend
End Sub
#

Have a nice time

Chris
------
Convert your Excel spreadsheet into an online calculator.
http://www.spreadsheetconverter.com

--
Message posted via http://www.officekb.com


TFMR

Sum of data
 
Hi Shane,

Here is an example:

A B C
AS 1
AD 6
AD 8
AE 0 15
AE 2
AG 5
AG 1
AG 0 8
AE 9
AR 4
AA 0 13

Hope it will clear the concept.

"Shane Devenshire" wrote:

Hi,

It would be nice to see a sample of the data with what you want as the result.

Possible if your data is in column A and the 0's are in column B

=SUMIF(B1:B100,0,A1:A100)

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire

"TFMR" wrote:

Dear All,

I have column with numeric data, I want the sum when value 0 come in column
then next sum until the value is 0.

Thnx & Regards


T. Valko

Sum of data
 
Assume the numbers start in cell B1.

Enter this formula in C2 and copy down as needed:

=IF(B2<0,"",SUM(B$1:B2)-SUM(C$1:C1))

--
Biff
Microsoft Excel MVP


"TFMR" wrote in message
...
Hi Shane,

Here is an example:

A B C
AS 1
AD 6
AD 8
AE 0 15
AE 2
AG 5
AG 1
AG 0 8
AE 9
AR 4
AA 0 13

Hope it will clear the concept.

"Shane Devenshire" wrote:

Hi,

It would be nice to see a sample of the data with what you want as the
result.

Possible if your data is in column A and the 0's are in column B

=SUMIF(B1:B100,0,A1:A100)

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire

"TFMR" wrote:

Dear All,

I have column with numeric data, I want the sum when value 0 come in
column
then next sum until the value is 0.

Thnx & Regards





All times are GMT +1. The time now is 04:48 AM.

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