excel - Count number of rows where multiple criteria are met -


i'm trying generate table shows count of how many items in given status on given day. result table has set of dates down column , column headers various statuses. sample of data table headers looks this:

product | notice | assigned | complete | in office | in accounting     1    | 5/5/13 |  5/7/13  | 5/9/13   |  5/10/13  |    5/11/13     2    | 5/5/13 |  5/6/13  | 5/8/13   |  5/9/13   |    5/10/13    3    | 5/6/13 |  5/9/13  | 5/10/13  |  5/10/13  |    5/10/13     4    | 5/4/13 |  5/5/13  | 5/7/13   |  5/8/13   |    5/9/13     5    | 5/7/13 |  5/8/13  | 5/10/13  |  5/11/13  |    5/11/13 

if output table contain set of dates in first column statuses headers, need count of how many rows @ given status , had not yet transitioned next status in notice column, i'd have count of rows notice date <= x , assigned, complete, in office, in accounting greater x.

i've used sum(if(frequency(if statement me close feel need have , statement within second if =sum(if(frequency(if(and

here's have won't work:

=sum(if(frequency(if(and(table1[assigned]<=a279,table1[[complete]:[in accounting]]<=a279),row(table1[[complete]:[in accounting]])),row(table1[[complete]:[in accounting]]))>0,1)) 

if take "and" portion out, works fine except need count rows given status has date if "assigned" date empty, don't want row counted assigned column.

here's example of i'd expect see in results. i've listed count in each column corresponding product numbers in parenthesis. corresponding product numbers reference , won't in result table.

date | notice  | assigned | complete  5/6 | 2 (1,3) | 2 (2,4)  |  0  5/7 | 2 (3,5) | 2 (1,2)  |  1 (4)  5/8 | 1 (3)   | 2 (1,5)  |  1 (2) 

ok, assuming have original data in a1:f6 2nd table headers in b9:d9 , row labels in a10:a12 can use "array formula" in b10

=sum((b$2:b$6<=$a10)*(mmult((c$2:$f$6>$a10)+(c$2:$f$6=""),transpose(column(c$2:$f$6)^0))=columns(c$2:$f$6)))

confirmed ctrl+shift+enter , copied down , across (see screenshot below)

as can see results per requirement. if replace dates blanks still work

mmultis way single value each row when looking @ multiple columns.

i used cell references because think that's easier, when copying formula across , having reducing range.......but can use structured references if want

enter image description here


Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

c++ - Correct method for redrawing a layered window -

java.util.scanner - How to read and add only numbers to array from a text file -