Forum Discussion

Soumyadip47's avatar
Soumyadip47
Copper Contributor
Feb 25, 2021
Solved

Countif till a certain value is reached

Hi,   I am editing my post and posting the whole requirement (attached workbook) which I am working on currently. This is basically a shortage report.   In the worksheet named "details" I have li...
  • JMB17's avatar
    JMB17
    Feb 27, 2021

    Soumyadip47 

     

    I'm not sure my understanding is correct, but try this in N3:

     

    =MAX((MMULT(--(ROW(Details!$J$2:$J$172)>=TRANSPOSE(ROW(Details!$J$2:$J$172))),MMULT(E3:M3*Details!$J$2:$R$172,--(TRANSPOSE(COLUMN(E3:M3)>0))))<=D3)*ROW(Details!$J$2:$J$172))

     

    You may need to hit Ctrl+Shift+Enter, unless you have the newest version of excel with dynamic arrays that may not require it.

     

    The formula does rely on the categories in Details columns J-R and Critical Components Columns E-M being in the same order.

     

    Also, I'm assuming you will be adding rows to the details tab? If so, I would add an empty border row at the bottom and insert new rows there (at row 172) - if you insert a row there, then you won't have to change the formula to reference your new rows (excel will take care of it).

     

    See attached workbook.

Resources