logical test problems creating formula

xcelvogelsong

New Member
Joined
Aug 17, 2010
Messages
2
I have multiple time frames and am trying to create a logical test that will return true if the time given is within the two times. any ideas
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Something like this gives you the idea of how to check whether a time is between an upper and lower time:
Excel Workbook
ABCD
1TimeIs Time Between Upper and LowerLower Time
22:00 AMFALSE4:15 AM
35:15 AMTRUEUpper Time
46:00 PMTRUE7:33 PM
52:33 PMTRUE
6
...
Cell Formulas
RangeFormula
B2=AND(A2>=$D$2,A2<=$D$4)
B3=AND(A3>=$D$2,A3<=$D$4)
B4=AND(A4>=$D$2,A4<=$D$4)
B5=AND(A5>=$D$2,A5<=$D$4)
 
Upvote 0
you are right, this formula does work for one time frame, I have multiple time frames that i need to find out if one given time fits into any of them
 
Upvote 0
Maybe this:

Here is the data, assumptions and formulas (formulas in green cells):
Excel Workbook
ABCDEF
1TimeIs Time Between Upper and LowerLower TimeLower TimeLower Time
22:00 AMFALSE4:15 AM4:15 PM5:53 PM
35:15 AMTRUEUpper TimeUpper TimeUpper Time
46:00 PMTRUE7:33 AM5:33 PM7:33 PM
52:33 PMFALSE
6
...


Enter this formula in B2 and copy down:

=OR(AND(A2>=$D$2,A2<=$D$4),AND(A2>=$E$2,A2<=$E$4),AND(A2>=$F$2,A2<=$F$4))



Picture of formula:
Excel Workbook
B
2FALSE
...
Cell Formulas
RangeFormula
B2=OR(AND(A2>=$D$2,A2<=$D$4),AND(A2>=$E$2,A2<=$E$4),AND(A2>=$F$2,A2<=$F$4))
 
Upvote 0

Forum statistics

Threads
1,215,022
Messages
6,122,726
Members
449,093
Latest member
Mnur

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