Can i use sumifs ?

debster007

New Member
Joined
Sep 10, 2014
Messages
2
The table below has several items that have multiple contracts and rates. I need a formula that prorates when the contracts change. For example, in the cashflow table for Item A, July 2016 should reflect 19 days @ 100 and 12 days @ 125 in July 2016.

[TABLE="width: 561"]
<tbody>[TR]
[TD="class: xl311, width: 74, bgcolor: transparent"][/TD]
[TD="width: 63, bgcolor: transparent"][/TD]
[TD="width: 79, bgcolor: transparent"][/TD]
[TD="width: 56, bgcolor: transparent"][/TD]
[TD="width: 56, bgcolor: transparent"][/TD]
[TD="width: 56, bgcolor: transparent"][/TD]
[TD="width: 56, bgcolor: transparent"][/TD]
[TD="width: 63, bgcolor: transparent"][/TD]
[TD="width: 63, bgcolor: transparent"][/TD]
[TD="width: 63, bgcolor: transparent"][/TD]
[TD="width: 57, bgcolor: transparent"][/TD]
[TD="width: 63, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl323, bgcolor: #BFBFBF"]Item
[/TD]
[TD="class: xl312, bgcolor: #BFBFBF"]Start Date
[/TD]
[TD="class: xl312, bgcolor: #BFBFBF"]End Date
[/TD]
[TD="class: xl314, width: 56, bgcolor: #BFBFBF"]Rate
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="class: xl320, bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl321, bgcolor: transparent"]A
[/TD]
[TD="class: xl322, bgcolor: transparent"]5/19/2014
[/TD]
[TD="class: xl322, bgcolor: transparent"]7/19/2016
[/TD]
[TD="class: xl324, bgcolor: transparent"] $ 100
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl321, bgcolor: transparent"]A
[/TD]
[TD="class: xl322, bgcolor: transparent"]7/19/2016
[/TD]
[TD="class: xl322, bgcolor: transparent"]7/19/2017
[/TD]
[TD="class: xl324, bgcolor: transparent"] $ 125
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl321, bgcolor: transparent"]B
[/TD]
[TD="class: xl322, bgcolor: transparent"]11/28/2013
[/TD]
[TD="class: xl322, bgcolor: transparent"]4/28/2016
[/TD]
[TD="class: xl324, bgcolor: transparent"] $ 75
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl321, bgcolor: transparent"]B
[/TD]
[TD="class: xl322, bgcolor: transparent"]4/28/2016
[/TD]
[TD="class: xl322, bgcolor: transparent"]4/28/2017
[/TD]
[TD="class: xl324, bgcolor: transparent"] $ 80
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl321, bgcolor: transparent"]C
[/TD]
[TD="class: xl322, bgcolor: transparent"]5/1/2014
[/TD]
[TD="class: xl322, bgcolor: transparent"]5/1/2015
[/TD]
[TD="class: xl324, bgcolor: transparent"] $ 105
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="class: xl319, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl321, bgcolor: transparent"]C
[/TD]
[TD="class: xl322, bgcolor: transparent"]5/1/2015
[/TD]
[TD="class: xl322, bgcolor: transparent"]4/30/2016
[/TD]
[TD="class: xl324, bgcolor: transparent"] $ 110
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl321, bgcolor: transparent"]D
[/TD]
[TD="class: xl322, bgcolor: transparent"]7/1/2014
[/TD]
[TD="class: xl322, bgcolor: transparent"]9/1/2016
[/TD]
[TD="class: xl324, bgcolor: transparent"] $ 130
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="class: xl319, bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl321, bgcolor: transparent"]D
[/TD]
[TD="class: xl322, bgcolor: transparent"]9/1/2016
[/TD]
[TD="class: xl322, bgcolor: transparent"]9/1/2017
[/TD]
[TD="class: xl324, bgcolor: transparent"] $ 135
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="class: xl315, bgcolor: transparent"][/TD]
[TD="class: xl313, bgcolor: transparent"][/TD]
[TD="class: xl313, bgcolor: transparent"][/TD]
[TD="class: xl317, bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl330, bgcolor: #BFBFBF"]Item:
[/TD]
[TD="class: xl329, bgcolor: #BFBFBF"]A
[/TD]
[TD="class: xl313, bgcolor: transparent"][/TD]
[TD="class: xl313, bgcolor: transparent"][/TD]
[TD="class: xl317, bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl327, bgcolor: #BFBFBF"]Dates:
[/TD]
[TD="class: xl328, bgcolor: #BFBFBF, align: right"]04/01/16
[/TD]
[TD="class: xl328, bgcolor: #BFBFBF, align: right"]05/01/16
[/TD]
[TD="class: xl328, bgcolor: #BFBFBF, align: right"]06/01/16
[/TD]
[TD="class: xl328, bgcolor: #BFBFBF, align: right"]07/01/16
[/TD]
[TD="class: xl328, bgcolor: #BFBFBF, align: right"]08/01/16
[/TD]
[TD="class: xl328, bgcolor: #BFBFBF, align: right"]08/01/16
[/TD]
[TD="class: xl316, bgcolor: #BFBFBF"][/TD]
[TD="class: xl328, bgcolor: #BFBFBF, align: right"]07/01/17
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl316, bgcolor: #BFBFBF"][/TD]
[TD="class: xl328, bgcolor: #BFBFBF, align: right"]04/30/16
[/TD]
[TD="class: xl328, bgcolor: #BFBFBF, align: right"]05/31/16
[/TD]
[TD="class: xl328, bgcolor: #BFBFBF, align: right"]06/30/16
[/TD]
[TD="class: xl328, bgcolor: #BFBFBF, align: right"]07/31/16
[/TD]
[TD="class: xl328, bgcolor: #BFBFBF, align: right"]08/31/16
[/TD]
[TD="class: xl328, bgcolor: #BFBFBF, align: right"]08/31/16
[/TD]
[TD="class: xl316, bgcolor: #BFBFBF"] . . . . . . . ..
[/TD]
[TD="class: xl328, bgcolor: #BFBFBF, align: right"]07/31/17
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl316, bgcolor: #BFBFBF"]Rate:
[/TD]
[TD="class: xl318, bgcolor: transparent"] $ 100
[/TD]
[TD="class: xl318, bgcolor: transparent"] $ 100
[/TD]
[TD="class: xl318, bgcolor: transparent"] $ 100
[/TD]
[TD="bgcolor: transparent"]<v:shapetype id="_x0000_t75" stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600"> <v:stroke joinstyle="miter"> <v:formulas> <v:f eqn="if lineDrawn pixelLineWidth 0"> <v:f eqn="sum @0 1 0"> <v:f eqn="sum 0 0 @1"> <v:f eqn="prod @2 1 2"> <v:f eqn="prod @3 21600 pixelWidth"> <v:f eqn="prod @3 21600 pixelHeight"> <v:f eqn="sum @0 0 1"> <v:f eqn="prod @6 1 2"> <v:f eqn="prod @7 21600 pixelWidth"> <v:f eqn="sum @8 21600 0"> <v:f eqn="prod @7 21600 pixelHeight"> <v:f eqn="sum @10 21600 0"> </v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:formulas> <v:path o:connecttype="rect" gradientshapeok="t" o:extrusionok="f"> <o:lock aspectratio="t" v:ext="edit"> See formula below</o:lock></v:path></v:stroke></v:shapetype>
[/TD]
[TD="class: xl318, bgcolor: transparent"] $ 125
[/TD]
[TD="class: xl318, bgcolor: transparent"] $ 125
[/TD]
[TD="class: xl318, bgcolor: transparent"] . . . . . . . . .
[/TD]
[TD="class: xl325, bgcolor: #FFC000"] $ -
[/TD]
[TD="bgcolor: transparent, colspan: 3"]

[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="class: xl326, bgcolor: transparent"]current formula:
[/TD]
[TD="bgcolor: transparent, colspan: 8"]=SUMIFS($D$4:$D$11,$A$4:$A$11,$B$13,$B$4:$B$11,"<="&E14,$C$4:$C$11,">="&E15)
[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Where do 19 days and 12 days come from?


edit: nevemind I see it
 
Upvote 0
It's more complicated than that. Try this, see if it will work. Paste it in the cell that you show see formula in your example.
=(LARGE(($C$4:$C$11-E14)*($C$4:$C$11-E14<=31),1)+1)*INDEX($D$4:$D$11,MATCH(E14,IF($A$4:$A$11=$B$13,$B$4:$B$11),1))+LARGE((-$B$4:$B$11+E15)*(-$B$4:$B$11+E15<=31),1)*INDEX($D$4:$D$11,MATCH(E15,IF($A$4:$A$11=$B$13,$C$4:$C$11),1)+1)
Use Ctrl+Shift+Enter
 
Upvote 0

Forum statistics

Threads
1,222,403
Messages
6,165,849
Members
451,986
Latest member
ExcelIsLove

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