PDA

View Full Version : how to sum based on data in corresponding rows



sweetness34
06-23-2011, 07:18 AM
Hi
I need to know the vba code on how to sum the hours in one column based on another corresponding column. The hard part is that the number of rows is variable so the location of the summed value is always changing and the range of the sum is sometimes 3 rows and sometimes 10.

Ex. picture in attachment

I need to sum the hours in column G based on column D then sum the hours in G based on column C. So cell H2 = 12, H3=16 , I3=28 (H2+H3), H5=17 (cells G4+G5), H6=49 (cells G4+G5+G6), etc.. In other words H2 is the sum of the "3D" hours of "Conveyor", H3 is the sum of "2D" hours of "Conveyor, I3 is the sum of "Conveyor" Hours (2D and 3D).

Thanks

Jacob Hilderbrand
06-23-2011, 10:27 AM
Cross Posted Here: http://www.mrexcel.com/forum/showthread.php?t=559448