I have three columns of information:
Date, Plant, Load Start (Time)
I allow filters so that the user can select some of the data to evaluate.
I am looking for the Minimum value of Load Start (a time) based on Date and Plant Criteria.
For the following:
DB_DATE is the column array of dates
DB_PL is the column array of Plants
DB_LS is the column array of Load Start
All arrays are the same size.
<date> [date] is the cell with the desired date
[plant]is a cell with the desired plant
This formula works swell but doesn't take filters into account:
<code><code>
=MIN(IF(DB_DATE=<date>[date],IF(DB_PL=[plant],DB_LS)))
</date></code></code>
This array formula only works if the *first* row of the array matches the criteria selected, it otherwise returns 0:
<code><code>
={(SUBTOTAL(5,OFFSET(DB_LS,ROW(DB_LS)-ROW([first row of DB_LS]),,1))*--(DB_PL=[plant])*--(DB_DATE=[date]<date>))}
</date></code></code>
I also tried sumproduct/subtotal with unhappy results, this returns the sum of all the rows that match the criteria instead of the minimum one:
<code><code>
={SUMPRODUCT(SUBTOTAL(5,OFFSET(DB_LS,ROW(DB_LS)-ROW([first row of DB_LS)),,1)),--(DB_PL=[plant]),--(DB_DATE=[date]<date>))}
</date></code></code>
I'm stuck. I really thought the second formula should work but doesn't.</date>
Date, Plant, Load Start (Time)
I allow filters so that the user can select some of the data to evaluate.
I am looking for the Minimum value of Load Start (a time) based on Date and Plant Criteria.
For the following:
DB_DATE is the column array of dates
DB_PL is the column array of Plants
DB_LS is the column array of Load Start
All arrays are the same size.
<date> [date] is the cell with the desired date
[plant]is a cell with the desired plant
This formula works swell but doesn't take filters into account:
<code><code>
=MIN(IF(DB_DATE=<date>[date],IF(DB_PL=[plant],DB_LS)))
</date></code></code>
This array formula only works if the *first* row of the array matches the criteria selected, it otherwise returns 0:
<code><code>
={(SUBTOTAL(5,OFFSET(DB_LS,ROW(DB_LS)-ROW([first row of DB_LS]),,1))*--(DB_PL=[plant])*--(DB_DATE=[date]<date>))}
</date></code></code>
I also tried sumproduct/subtotal with unhappy results, this returns the sum of all the rows that match the criteria instead of the minimum one:
<code><code>
={SUMPRODUCT(SUBTOTAL(5,OFFSET(DB_LS,ROW(DB_LS)-ROW([first row of DB_LS)),,1)),--(DB_PL=[plant]),--(DB_DATE=[date]<date>))}
</date></code></code>
I'm stuck. I really thought the second formula should work but doesn't.</date>