Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Loop and running total
I need to loop from row 50 to 1, step -1. Addin the values in Col A is equal
as long as they are equal to the one above. How can i keep a running total that adds the value in A every time it repeats? Thanks in advance |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Loop and running total
Luis,
Use a worksheet function: =SUMPRODUCT((A1:A49=A2:A50)*A2:A50) or in a macro Sub TotalCalA() Dim i As Long Dim TotalA As Double For i = 50 to 2 Step -1 If Cells(i,1).Value = Cells(i-1,1).Value Then TotalA = TotalA + Cells(i,1).Value End if Next i Msgbox TotalA End Sub HTH, Bernie MS Excel MVP "LuisE" wrote in message ... I need to loop from row 50 to 1, step -1. Addin the values in Col A is equal as long as they are equal to the one above. How can i keep a running total that adds the value in A every time it repeats? Thanks in advance |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Duplicate Running Total Grand Total In Pivot Table | Excel Discussion (Misc queries) | |||
Running total of Found Substrings in MainString in Big Loop | Excel Programming | |||
running total and average of that total after 3 events | Excel Discussion (Misc queries) | |||
running total and average of that total after 3 events | Excel Discussion (Misc queries) | |||
% of Running Total to Grand Total in Pivot Table | Excel Programming |