Thanks:  0
Likes:  0

# Thread: IF function in Time Range

1. ## IF function in Time Range

Good day... I need an IF Function that will allow me to action a time in a time range:

... If the time 04:16 falls in the time range 04:00 - 04:29, than put a one (1) in the filed x...
... If the time 04:16 doesn't fall in the time range 04:00 - 04:29, than leave the x fiel empty

Any help is appreciated.

2. ## Re: IF function in Time Range

Think this might help if you have the start time of the range in cell A10 and end time of the range in cell B10:

C10 is the time to check.

Code:
`=IF(AND(C10>=A10,C10<=B10),1,"")`

3. ## Re: IF function in Time Range

welcome to MrExcel Board.....

try this

=IF(AND(C20>=TIME(4,0,0),C20<=TIME(4,29,0)),1,"")
where c20 is the time to check

4. ## Re: IF function in Time Range

Great... It works. Thanks for your help.

5. ## Re: IF function in Time Range

I have still a problem with a "time" field (in our expl C20)...
C20 is an answer to a Fuction, and I think, that the IF Function is not able to analize an answer and use it as a data for another function. Could that be right?

6. ## Re: IF function in Time Range

no excel uses the answer. Post a sample of your data with the formula you are using

7. ## Re: IF function in Time Range

 1 A B C D E F G H I J K 2 Dep LT Arr LT Rel ETD minus Rel Time LT Z Cor + Rel Time Z Rel Time AKL 03:30-03:59 04:00-04:29 04:30-04:59 05:00-05:29 3 4 5 6 7 8 06:45 11:30 01:30 05:15 11:00 16:15 04:15 9 06:40 09:50 01:30 05:10 11:00 16:10 04:10 10 19:00 22:10 01:30 17:30 11:00 04:30 16:30 11 03:15 06:25 01:30 01:45 11:00 12:45 00:45 12 12:25 15:35 01:30 10:55 11:00 21:55 09:55 13 21:35 00:45 01:30 20:05 11:00 07:05 19:05

Fiel G8 uses: =G8+("12:00">G8)-"12:00" to change F8 to local time.

Column G should be analyzed according my idea as before, and the answer with a 1 should end up in the H to K - 8 to 13.

Thanks

8. ## Re: IF function in Time Range

is this it?
Sheet4

 A B C D E F G H I J K 1 Dep LT Arr LT Rel ETD minus Rel Time LT Z Cor + Rel Time Z Rel Time AKL 03:30-03:59 04:00-04:29 04:30-04:59 05:00-05:29 2 3 3:30 4:00 4:30 5:00 4 3:59 4:29 4:59 5:29 5 6 7 6:45 11:30 1:30 5:15 11:00 16:15 4:15 1 8 6:40 9:50 1:30 5:10 11:00 16:10 4:10 1 9 19:00 22:10 1:30 17:30 11:00 4:30 16:30 10 3:15 6:25 1:30 1:45 11:00 12:45 0:45 11 12:25 15:35 1:30 10:55 11:00 21:55 9:55 12 21:35 0:45 1:30 20:05 11:00 7:05 19:05

 Cell Formula H7 =IF(AND(\$G7>=H\$3,+\$G7=I\$3,+\$G7=J\$3,+\$G7=K\$3,+\$G7=H\$3,+\$G8=I\$3,+\$G8=J\$3,+\$G8=K\$3,+\$G8=H\$3,+\$G9=I\$3,+\$G9=J\$3,+\$G9=K\$3,+\$G9=H\$3,+\$G10=I\$3,+\$G10=J\$3,+\$G10=K\$3,+\$G10=H\$3,+\$G11=I\$3,+\$G11=J\$3,+\$G11=K\$3,+\$G11=H\$3,+\$G12=I\$3,+\$G12=J\$3,+\$G12=K\$3,+\$G12

Excel tables to the web >> Excel Jeanie HTML 4

9. ## Re: IF function in Time Range

Something is not right...
It works on a test sheet but not with the answer from the field G7.
Is my function correct in the G7 to add 12h to the field F7: =F7+("12:00">F7)-"12:00"?
Thanks

## User Tag List

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•