• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Find the first value in a range that is higher or lower.

dv0x

New Member
Hi Ninjas,

I am trying to find the first value in a range that is higher or lower than a given value and then return a corresponding value in the same row, but a different column. Whether the value sought in the range is higher or lower is dependent upon 2 scenarios. I have attached a sample to define the problem(s) more precisely.

I understand that the most practical solution may be to combine Scenario 1 and Scenario 2 in one cell and then Scenario 1 and Scenario 3 in another cell instead of trying to get it all done in one formula.

Thank you
 

Attachments

Dear dv0x

An array formula such as (this is for cell m83)

=IF(L83="OPEN","",IF(L83="CLOSED",IF(K83="DOWN",INDIRECT("A"&MIN(IF(C3:C83>H2,ROW(C3:C83),MAX(ROW(C3:C83))))),IF(K83="UP",INDIRECT("A"&MIN(IF(D3:D83<H2,ROW(D3:D83),MAX(ROW(D3:D83))))),"N/A")),"N/A"))

achieves your aims.

This can also be cut and pasted into the other m cells to generate all the desired behaviours.
 
Thank you for your input @bines53. For my purposes that formula would need some modification as the range C3:C83 sometimes moves to column D. I think I could make it work by adding a IF statement.

Regards
 
Back
Top