Looking at dates for greater than and less than

FryGirl

Well-known Member
Joined
Nov 11, 2008
Messages
1,364
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
For some reason, I can't figure out the logic here

I need to compare A2 against the dates in row 1. If the date in row 1 is greater than A2, but less then the next date then place a 1.

Since A2, 19-Oct-16 is greater than D1, but less than E1, then D2 should be a 1.

Data Range
A​
B​
C​
D​
E​
1​
3-Oct-16​
10-Oct-16​
17-Oct-16​
24-Oct-16​
2​
19-Oct-16​
0​
0​
1​
0​
 
Last edited:

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Insert in B2 and fill right/down:

=+IF(AND($A2>B$1,$A2<c$1),"1","0")

EDIT: the formula keeps getting cut. <c$1),1,0)< html=""></c$1),1,0)<></c$1),"1","0")
 
Last edited:
Upvote 0
<c$1),"1","0")
likely just have to put quotes around your formula so the forum software isn't seeing it as a formula?


</c$1),"1","0")
 
Upvote 0
This?

=IF(AND($A$2 > B$1,$A$2 < C$1),1,0)<c $1),1,0)<="" html=""></c>
 
Last edited:
Upvote 0
<c$1),"1","0")
likely just have to put quotes around your formula so the forum software isn't seeing it as a formula?

No, just spaces around the < character, which otherwise it doesn't like. :)


</c$1),"1","0")
 
Last edited:
Upvote 0
Just figured out what I was doing wrong. I had the references reversed.

I used =IF(AND(B$1>=$A$2,C$1<$A$2),"♦","") that's why I was getting horrible results :(
 
Upvote 0

Forum statistics

Threads
1,214,834
Messages
6,121,877
Members
449,056
Latest member
ruhulaminappu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top