Reputation: 15
I'm sticking with data do you know the formula for the below question.
The result should be 1 if the date is between the start date and the end date.
Upvotes: 1
Views: 891
Reputation: 27233
You may try in this way as well, BOOLEAN LOGIC
Formula used in cell E2
=(E$1>=$A2)*(E$1<=$B2)
And Fill Down & Fill Across
And set the formatting as --> Select the ranges, press CTRL 1 --> Format Cells --> Number Tab --> Custom --> Type --> 0;;
Note On BOOLEAN LOGIC :
• A Boolean
is a data type with only two possible values, TRUE
or FALSE
.
• Boolean
values is that they have numeric equivalents that can be used in formulas.
• During a math operation, Excel will coerce Booleans into numbers, TRUE
becomes "1", and FALSE
becomes "0".
• No Nesting. No IF statements. Excel simply runs the calculation and returns the result. That's the gist of Boolean logic.
Upvotes: 1
Reputation: 54777
In cell E2
use:
=IF(AND(E$1>=$A2,E$1<=$B2),1,"")
Upvotes: 1