Reputation: 2209
I have a problem and looking for a smart solution.
In my excel sheet, I defined the following columns with values:
MasterSheet
:
I'm working with the following function in Column C of MasterSheet:
=SUMIFS(
CalcSheet!D:D;
CalcSheet!A:A; A4;
CalcSheet!E:E; E4;
CalcSheet!B:B; "<="&B4;
CalcSheet!C:C;">"&B4
)
How can I define the case, when an ID don't have a max value? When I let the cell empty, I get the value 0. So that my solution for the moment is to set the Max value to a bigger value then the Volume is. But it isn't a nice solution.
CalcSheet:
MasterSheet:
Upvotes: 0
Views: 2019
Reputation: 22876
If you leave the Max value cell empty, then you can have OR condition like this:
= SUMIFS( CalcSheet!D:D; CalcSheet!A:A; A4; CalcSheet!E:E; E4; CalcSheet!B:B; "<="&B4; CalcSheet!C:C;">"&B4 )
+ SUMIFS( CalcSheet!D:D; CalcSheet!A:A; A4; CalcSheet!E:E; E4; CalcSheet!B:B; "<="&B4; CalcSheet!C:C;"" )
or with one SumProduct
formula:
= SumProduct( CalcSheet!D:D * ( CalcSheet!A:A = A4 ) * ( CalcSheet!E:E = E4) *
( CalcSheet!B:B <= B4 ) * ( ( CalcSheet!C:C > B4 ) + ( CalcSheet!C:C = "" ) ) )
Upvotes: 1