using SUMIF for date ranges (with blanks)

shemnel

New Member
Joined
Nov 7, 2013
Messages
3
Hello,

I have some data that I want to add up cumulatively but it has a condition on its date of operation in other columns

for instance;

ABCD
112341990
267319901997
321341991
4787819921996
501992
656719941999
701996
8431998
93461998
1001999

<colgroup><col span="4"></colgroup><tbody>
</tbody>

Column A is facility, B is amount produced, C is year opened and D is year shut (blank if not shut)

I want to produce a result that will allow me to cumulatively add up production year by year, 1990, then 1991 in the row below, 1992 below that etc, all beginning from 1990.

I can do that bit, but I am running into problems as when I get to say 1998, the sites that shut in 1996 can only be included up to 1996, they have to stop being counted in 1997 and 1998. Blank cells are also causing a problem in SUMIF (not sure 0 is acceptable in the final presentation)

thanks for your help

S
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Welcome to MrExcel.

Is this what you want (formula in E1 copied down)?

Excel 2010
ABCDE
11123419901234
22673199019971907
33213419914041
4478781992199611919
550199211919
665671994199912486
770199612486
884319983978
9934619984324
1010019994324

<COLGROUP><COL style="BACKGROUND-COLOR: #dae7f5"><COL><COL><COL><COL><COL></COLGROUP><THEAD>
</THEAD><TBODY>
</TBODY>
Sheet1

Worksheet Formulas
CellFormula
E1=SUMPRODUCT(--(C$1:C1<=C1),(ISBLANK(D$1:D1)+(D$1:D1>=C1)),B$1:B1)

<THEAD>
</THEAD><TBODY>
</TBODY>

<TBODY>
</TBODY>
 
Upvote 0
thanks very much, that is getting very close.

I think really I need a separate table below, where there is a cumulative total for every year, i.e. 1990 then below that 1991, and then 1992, then 1993 etc etc to 2000

what you have is pretty darn close though
 
Upvote 0
Like this?


Excel 2010
ABCD
1112341990
2267319901997
3321341991
44787819921996
5501992
6656719941999
7701996
88431998
993461998
101001999
11
1219901907
1319914041
14199211919
15199311919
16199412486
17199512486
18199612486
1919974608
2019984324
2119994324
Sheet1
Cell Formulas
RangeFormula
B12=SUMPRODUCT(--(C$1:C$10<=A12),(ISBLANK(D$1:D$10)+(D$1:D$10>=A12)),B$1:B$10)
 
Upvote 0

Forum statistics

Threads
1,215,688
Messages
6,126,213
Members
449,301
Latest member
rcocrane99

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
Back
Top