Hi,
I have the following code:
At present it is searching range $A$2:$A$154810, comparing the month of a cell in the range, to cell L40, which states a month.
If the month is the same, then it is searching range $B$2:$B$154810 to check whether the time of a cell in the range is between two different times (N38 & N39).
If all of those are true, then it returns a number in the range $C$2:$C$154810.
MY QUERY ...
At present, the first query is just looking up the month (mmm) of the date in the range $A$2:$A$154810.
Is it possible to ALSO look up the day (d) of the date in the range? And compare it to a 'day value' (1-31) in cell M40?
I tried modifing:
IF(TEXT($A$2:$A$154810,"mmm")=$L40,
to
IF(AND(TEXT($A$2:$A$154810,"mmm")=$L40,TEXT($A$2:$A$154810,"d")=$M40),
but unfortunately that did not work.
I have the following code:
Code:
=IFERROR(MIN(
IF(TEXT($A$2:$A$154810,"mmm")=$L40,
IF($B$2:$B$154810>=N$38,
IF($B$2:$B$154810<=N$39,
IF(ISNUMBER($C$2:$C$154810),
$C$2:$C$154810))))),"")
At present it is searching range $A$2:$A$154810, comparing the month of a cell in the range, to cell L40, which states a month.
If the month is the same, then it is searching range $B$2:$B$154810 to check whether the time of a cell in the range is between two different times (N38 & N39).
If all of those are true, then it returns a number in the range $C$2:$C$154810.
MY QUERY ...
At present, the first query is just looking up the month (mmm) of the date in the range $A$2:$A$154810.
Is it possible to ALSO look up the day (d) of the date in the range? And compare it to a 'day value' (1-31) in cell M40?
I tried modifing:
IF(TEXT($A$2:$A$154810,"mmm")=$L40,
to
IF(AND(TEXT($A$2:$A$154810,"mmm")=$L40,TEXT($A$2:$A$154810,"d")=$M40),
but unfortunately that did not work.