The question is a little ambiguous, with several open questions in comments. To cover the bases, I'll provide three examples based on different interpretations of the question.
Example 1
Assumptions:
Month inclusion means any part of the month (in your example, April would be considered to fall in the range). See the second example, below, if this assumption is not correct.
The fixed cell month is entered as month number (10
instead of October
). See the third example, below, if this assumption is not correct.
Lets say the data is in row 2, the fixed cell is C2 and the result is in D2. One formula that would work in D2:
=IF(AND(C2>=MONTH(A2),C2<=MONTH(B2)),"Yes","No")
Example 2 (inclusion = entire month)
If month inclusion means the entire month must be within the date range, you could use a formula like this:
=IF(AND(DATE(YEAR(A2),C2,1)>=A2,DATE(YEAR(A2),C2,DAYSINMONTH(DATE(YEAR(A2),C2,1)))<=B2),"Yes","No")
This compares the first and last day of the month to the date range.
Example 3 (month name)
If the month needs to be entered as month name, you can handle that by replacing all references to C2 in the above formulas with:
MONTH(DATEVALUE(C2&" 1"))
This turns the month name into a date (the first day of that month), and then finds its month number. So, for instance, the formula in Example 1 would be converted to:
=IF(AND(MONTH(DATEVALUE(C2&" 1"))>=MONTH(A2),MONTH(DATEVALUE(C2&" 1"))<=MONTH(B2)),"Yes","No")
One other note: your question suggests that the month in the fixed cell may apply to a collection of date ranges. If so, anchor the references to C2 if you copy the formula to other cells by using $C$2 instead of C2 in the above formulas.