• 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.

Compare range of values

I have a range of values in Row 1 Columns A to D that I call Range A. Also, another range of values in Row 1 Columns F-G that I call Range B.

This is what I need.
If any value between the low and high of Range A falls between the low and high of Range B then return "Yes" in Column I otherwise return "No".

I attached the sample worksheet. Thanks.
 

Attachments

Hi Narayan. As a follow up I realized that I need to search through the ranges. For example:

I have a range of values in Columns A to D that I call Range A. Also, another range of values in Columns J-K that I call Range B.

This is what I need.

Go row by row in Range A and If any value between the low and high of the row in Range A falls between the low and high of ANY of the ranges in Range B then return "Yes" in Column F for that row and return the corresponding zone number in column G for that row. Otherwise return "No" in column F.

I attached a revised worksheet with a few sample manual results.

Thanks
 

Attachments

Hi Narayan. I will have multiple worksheets for each currency pair with the same Range formats as sheet EURUSD, but with different values. Will I have to define names as you did for all of these worksheets?
 
Hi westend9876,

Another alternate formula:

For getting Yes/No in Cell F3:
=IF(MAX(MMULT(--(($J$4:$J$13<=$A3:$D3))*--(($K$4:$K$13>=$A3:$D3)),TRANSPOSE(COLUMN($A3:$D3)^0))),"Yes","")

Here J4:J13 Lower Zone Value & K4:K13 has Upper Zone Value.

For getting zone number in G3:
=IF(F3="","",INDEX($I$4:$I$13,MATCH(TRUE,MMULT(--(($J$4:$J$13<=$A3:$D3))*--(($K$4:$K$13>=$A3:$D3)),TRANSPOSE(COLUMN($A3:$D3)^0))>0,0)))

Here I4:I13 is Zone number and Upper zone Number & Lower Zone number as above.

Please note that both the formulas are array formula so must be entered with Ctrl+Shift+Enter.

Regards,
 
Back
Top