Excel: Check to see if Two Values are Between Two Other Values

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


Excel: Check to see if Two Values are Between Two Other Values



I am having a nightmare of a time trying to find a solution to this problem, and am hoping you wizards can help.



In the example below, I have a dataset (columns A through C), and reference columns (F to H). Column D is the desired output for the formula. This column has been populated with an example of the output I want.



Table 1.



Dataset 1



Table 1 shows my dataset. My goal is to generate (using a formula) an output in column D that classifies whether data in rows 2-14 in columns B & C fall within the start and end parameters of my reference dataset in columns G & H. If true, the formula should return the line number as shown in column F where the match exists in column D.


column D


rows 2-14


columns B & C


columns G & H


column F


column D



Using IF(AND( formulas, I was able to figure out how to do this so long as the start and end of B & C were >= to G, and <= to H. Example: =IF(AND(B2>=$G$2,C2<=$H$2),$F$2,IF(AND(B2>=$G$3,C2<=$H$3),$F$3,"<null>"))


IF(AND(


>= to G


<= to H


=IF(AND(B2>=$G$2,C2<=$H$2),$F$2,IF(AND(B2>=$G$3,C2<=$H$3),$F$3,"<null>"))



As depicted in Figure 1 below, Line 1 shows the bounds that are described in 'G2:H2', while Line 2 shows the bounds described in 'G3:H3'. My goal is to see if Lines 3 & 4 overlap with Line 1 or Line 2, and output a variable like shown in 'column D'. Any help would be MUCH appreciated. Thank you.


Figure 1



Figure 1.



Figure 1









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Arduino Mega cannot recieve any sketches, stk500_recv() programmer is not responding

Visual Studio Code: How to configure includePath for better IntelliSense results

C++ virtual function: Base class function is called instead of derived