Need a formula please

dal777

New Member
Joined
Dec 6, 2005
Messages
5
Hi all,I'm in need of some help. As you can see from the image below I need a function/s in D4 that will total ( in this case ) B3 to B7. Because the lists vary in the number of rows a simple SUM(B3:B7) which I could copy and paste will not work, what I need is a more dynamic formula which will work out how many rows it should sum, when A=1 that is the last row that should be added to the sum. By the way is doesnt matter what values - if any end up in the D column cells except where C=0, hope that makes sense.
I will want to copy / paste the formula in D3 all the way down the D column.

The cells are colour coded for easier identifcation - a new colour is a new list

I'd been trying to work this out for a while but just cant figure it out so any help / suggestions would really be apprciated - thanks.


Click to see a sample of the sheet: http://img.photobucket.com/albums/v732/dal777/excel.jpg

Edited by Von Pookie ~ picture was kind of large
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

adulted

Active Member
Joined
Jan 22, 2004
Messages
339
If Sum

Dal777
Try this in D3:
=IF(C3=0,"",SUM(B3:B21))
Double click the fill handle to copy down the remaining cells.
or
=IF(C3=0,"",SUM($B$3:$B$21))
if the column B range remains the same rows 3 to 21

Hope this is what your after
Paul
 

barry houdini

MrExcel MVP
Joined
Mar 23, 2005
Messages
20,825
Try in D3 copied down

=IF(C3<>0,"",SUM(B3:INDEX(B3:B$100,MATCH(1,A3:A$100,0))))

Change 100 for a higher number if your data goes further
 

dal777

New Member
Joined
Dec 6, 2005
Messages
5
Barry - Yes it works, nice one, thanks , I'd never had have been able to figure that one out on my own, I'll now be able to sort a huge amount of data- thank you.


:biggrin:
Regards.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,990
Messages
5,834,761
Members
430,318
Latest member
ZackChua95

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top