Excel 2013 - Sum with a date range -
good day, have decided ask help. have 1 workbook, multiple worksheets. formula gives me #value! understanding has wrong datatype. wanting @ range within 1 column of dates, add column of numbers in 2 separate columns , divide 2 columns , multiply 30. amounts this. sum(d31/c31)*30. small formula works great when using numbers. taking total hours divided amount of production multiplied 30 dollars per hour. each month of year.
the 2 sheets labeled follows. formula below resides on sheet "monthly". referencing sheet "overall cost". hoping have given enough information perhaps might have time assist me. note: have range pretty long because supposed work whole year made 10,000 rows deep.
formula:
=sumproduct(('overall cost'!$b$3:$b$10000<=date(2015,9,30))*('overall cost'!$b$3:$b$10000>=date(2015,9,1)),sum(('overall cost'!$d$3:$d$10000)/sum('overall cost'!$c$3:$c$10000))*30)
sample data:
"b" "c" "d" sq ft hours date oh oh wednesday 8/10/15 3427 232 thursday 8/11/15 5536 232 friday 8/12/15 2364 232 monday 8/1/15 6408 232 tuesday 9/4/15 2499 232 wednesday 9/5/15 870 232
you cannot use sum function within sumproduct function that. sumproduct trying process each row row , sum totalling of rows single figure.
you going number of #div/0!
errors due sumproduct's strong calculation mode. rows ranging down 10000 can truncated extent of dates in column b. since criteria, stands reason no numbers in column c , d significant in rows beyond last date.
=sumproduct(('overall cost'!b$3:index('overall cost'!b:b, match(1e+99, 'overall cost'!b:b ))<date(2015, 10, 1))* ('overall cost'!b$3:index('overall cost'!b:b, match(1e+99, 'overall cost'!b:b ))>=date(2015, 9, 1)), 'overall cost'!$d$3:index('overall cost'!d:d, match(1e+99,'overall cost'!b:b)), 30/'overall cost'!$c$3:index('overall cost'!c:c, match(1e+99,'overall cost'!b:b )))
i've adjust maths hierarchy bit. multiplying division of columns c , d same multiplying column d fraction created 30 on column c.
providing have no 0 values in column c should alright. if iferror function or additional criteria may have brought in. formula limits calculation needed no blank 'safety-zone' of blank cells.
if yo still receiving #div/0!
errors there must blank cells or cells 0 in column c. #div/0!
error literally that; trying divide number zero.
this can solved iferror function layer of processing required need use ctrl+shift+enter↵ finalize following formula.
=sumproduct((oc!b$3:index(oc!b:b, match(1e+99, oc!b:b ))<date(2015, 10, 1))* (oc!b$3:index(oc!b:b, match(1e+99, oc!b:b ))>=date(2015, 9, 1)), oc!$d$3:index(oc!d:d, match(1e+99,oc!b:b)), iferror(30/oc!$c$3:index(oc!c:c, match(1e+99,oc!b:b )), 0))
this can mimicked non-cse formula forcing numerator 0 , denominator 1 when encountering #div/0!
situation.
=sumproduct((oc!b$3:index(oc!b:b, match(1e+99, oc!b:b ))<date(2015, 10, 1))* (oc!b$3:index(oc!b:b, match(1e+99, oc!b:b ))>=date(2015, 9, 1))* (oc!$c$3:index(oc!c:c, match(1e+99,oc!b:b ))<>0), oc!$d$3:index(oc!d:d, match(1e+99,oc!b:b)), 30/(oc!$c$3:index(oc!c:c, match(1e+99,oc!b:b ))+ (oc!$c$3:index(oc!c:c, match(1e+99,oc!b:b ))=0)))
Comments
Post a Comment