Home > Forum Home > Automating Data Analysis Tasks > Cumulative formula based on entries > Data Filter with Subtotals Share

Data Filter with Subtotals

Excel Help for Data Filter With Subtotals in Automating Data Analysis Tasks


Forum TopicLogin

Data Filter With Subtotals

Rate this:
(3/5 from 1 vote)
ShockedYou could try to filter your data and then enter your formula as a subtotal.  You would need to distinquish each group of L's spearately in column I.

Alternatively, you could use some VBA code to run the cumulative sums between the W values.

Excel Spreadsheet:
 IJKL
1    
2 L 5 7.5 7.5
3 L 11.25 13.75 21.25
4 W - - 
5 L 3.75 6.25 6.25
6    


Assuming you wanted to sum on column K you could select the cells in column L and run the following VBA code:

VBA Code:
Sub Sum_I()
Dim tempsum As Single
Dim a As Variant
tempsum = 0
For Each a In Selection
    If Trim(a.Offset(0, -3).Value) = "L" Then
        tempsum = tempsum + a.Offset(0, -1).Value
        a.Formula = tempsum
    Else
        tempsum = 0
    End If
Next a
End Sub

 Excel Business Forums Administrator
 Posted by on
 
View Full Post

Excel templates and solutions matched for Data Filter with Subtotals:

Solutions: Workbook Search