# Sum values in cell from variable rows (rows are added and deleted)

1. ## Sum values in cell from variable rows (rows are added and deleted)

Hello all. Need some help summing data in several columns on a sheet that will have rows added and removed. In the attached workbook, the SNSs sheet has two sums (currently rows 14 and 15) for certain rows in columns D, F, H, J, L, N, P. The two sums for each column correlate to the the type of data being summed, so the Pack sum is the sum of every Pack value in the respective column. The same for Council summing all the Council data. The SUM calculation in row 3 columns D, F, H, J, L, N, P also need to be variable to sum all the rows in their respective columns (sums from the column to the left). Since this is basically summing every other row, I am at a total loss how to add this to the code that adds the Scout to the sheet, or set the formulas in the cells themselves. Any help would be appreciated.

Code that adds the Scouts to the sheet is below: ``Please Login or Register  to view this content.``
Thanks,
Andrew  Register To Reply

2. ## Re: Sum values in cell from variable rows (rows are added and deleted)

Andrew

Why don't you use SUMIF? So for example, enter the following into cell D14:

=SUMIF(B7:D12,B14,D7:D12)

and you get the answer \$643.56.

Dion  Register To Reply

3. ## Re: Sum values in cell from variable rows (rows are added and deleted)

Thanks Dion!!! I was looking too hard for the difficult answer and overlooked the simple one!!

Andrew  Register To Reply