excel - Sum minimum of corresponding column values - limited to date range -


i have data set 4 columns: start date, end date, scheduled qty, , actual quantity:

start date    end date    scheduled qty    actual qty 04/13/15      04/17/15    35               19 04/20/15      04/24/15    35               42 04/27/15      05/01/15    35               41 05/04/15      05/08/15    35               41 

i want find total actual, except when actual exceeds scheduled want used scheduled number.

in answered question (sum minimum of corresponding column values) found array formula works total lesser values of each row qty columns (quotes used display less symbol):

=sum(if(c1:c4"<"d1:d4, c1:c4, d1:d4)) 

this gives me total whole range, i'd limit date range such end dates within given month. i've used sumifs in other situations @ end dates , sum data falls within given month, i'm not figuring out how combine idea 1 array formula.

any ideas how make happen? i'm working in excel 2013.

here's extension of chancea's approach: excel's sum function (and average, stdev, etc.) have useful behavior of "skipping" on text values. example average(3, 4, "dog", 5) returns 4. can leverage behavior nested if's inside sum. instance,

=sum(if(month(b1:b4)=4,if(c1:c4<d1:d4,c1:c4,d1:d4),"no")) 

will sum (a) lesser of scheduled , actual (b) when month 4

this accomplished nested if's. outer if if(month(b1:b4)=4,...,"no") [if month <> 4, if returns text ("no"), sum skips]

the inner if same 1 chancea showed. can nest many tests/filters data need


Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

Kivy: Swiping (Carousel & ScreenManager) -