# Excel formula if time fall between

#### Mihailovskii

##### New Member
I have current time [=NOW()] in cell D5, and i have 2 times in cells A1 & A2.

D5 = NOW()
A1 = 07:00
A2 = 15:00

I need formula in "B5", if time from D5 fall between A1 & A2 to be 1, if time is greater or lower to be 0.

I try it with =IF(D5=MEDIAN(A1:A2);1;0) but it don't work.

### Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

#### azumi

##### Well-known Member
in B5:

=IF(AND(D5-INT(D5)>=A1,D5-INT(D5)<=A2),1,0)

#### Mihailovskii

##### New Member
in B5:

=IF(AND(D5-INT(D5)>=A1,D5-INT(D5)<=A2),1,0)

Thanks brother,
It's work!

Last edited:

Replies
3
Views
511
Replies
4
Views
163
Replies
3
Views
267
Replies
1
Views
173
Replies
7
Views
254

1,195,940
Messages
6,012,426
Members
441,699
Latest member

### 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.

### Which adblocker are you using?

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

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