If statement to give a 'yes' or 'no' if a time fall between a range

chrisb360

New Member
Joined
Sep 13, 2021
Messages
5
Office Version
  1. 365
Platform
  1. Windows
Hi all,

I am trying to get a yes/no answer if a cell is between a time range. It is set up as a table on Office 365. I have tried IF and IFS statements with both AND and TIMEVALUE in it. I have attached a screen grab of what i'm working with at the moment.

Any help is greatly appreciated.

Chris


View attachment 46775
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
1631525390985.png
 
Upvote 0
Welcome to the Mr Excel board!

We cannot tell much from an image. MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
QF 96 Driver supplement.xlsx
FGHIJK
6Start TimeStart Time2End TimeTime on roadMileageEarly start
3506/09/2021 06:0806:08:1806/09/2021 18:2012:12:20324.81No
3606/09/2021 07:3907:39:4106/09/2021 13:5706:18:00194.619No
3706/09/2021 08:3108:31:5506/09/2021 19:5111:19:44266.403No
Sheet1
Cell Formulas
RangeFormula
I35:I37I35=IF([@[Start Time]]<>"",[@[End Time]]-[@[Start Time]],"")
K35K35=IFS([@[Start Time]]>=TIMEVALUE("06:30:00"), "No",[@[Start Time]]>=TIMEVALUE("00:00:00"),"Yes")
K36K36=IF([@[Start Time]]>=TIMEVALUE("06:30:00"), "No",IF([@[Start Time]]>=TIMEVALUE("06:30:00"),"Yes"))
K37K37=IF(AND([@[Start Time]]<TIMEVALUE("06:30:00"),[@[Start Time]]>TIMEVALUE("00:00:00")),"Yes","No")
 
Upvote 0
consider
Time.xlsm
FGHIJK
3506-Sep-21 06:0806-Sep-21 06:0806-Sep-21 18:2012:12324.81No
3606-Sep-21 07:3906-Sep-21 07:3906-Sep-21 13:5706:18194.619Yes
3e
Cell Formulas
RangeFormula
I35:I36I35=IF(F35<>"",MOD(H35,1)-MOD(F35,1),"")
K35:K36K35=IF(MOD(F35,1)>=TIMEVALUE("06:30:00"), "Yes","No")


between a range of times
Time.xlsm
FGHIJK
3806-Sep-21 06:0806-Sep-21 06:0806-Sep-21 18:2012:12324.81Yes
3e
Cell Formulas
RangeFormula
I38I38=IF(F38<>"",MOD(H38,1)-MOD(F38,1),"")
K38K38=IF(AND(MOD(F38,1)>=TIMEVALUE("00:00:02"),MOD(F38,1)<=TIMEVALUE("06:30:00")), "Yes","No")
 
Last edited:
Upvote 0
Solution
consider
Time.xlsm
FGHIJK
3506-Sep-21 06:0806-Sep-21 06:0806-Sep-21 18:2012:12324.81No
3606-Sep-21 07:3906-Sep-21 07:3906-Sep-21 13:5706:18194.619Yes
3e
Cell Formulas
RangeFormula
I35:I36I35=IF(F35<>"",MOD(H35,1)-MOD(F35,1),"")
K35:K36K35=IF(MOD(F35,1)>=TIMEVALUE("06:30:00"), "Yes","No")


between a range of times
Time.xlsm
FGHIJK
3806-Sep-21 06:0806-Sep-21 06:0806-Sep-21 18:2012:12324.81Yes
3e
Cell Formulas
RangeFormula
I38I38=IF(F38<>"",MOD(H38,1)-MOD(F38,1),"")
K38K38=IF(AND(MOD(F38,1)>=TIMEVALUE("00:00:02"),MOD(F38,1)<=TIMEVALUE("06:30:00")), "Yes","No")
Hi Dave,

its not so much between the two numbers in the cells but if the start time in F35 is between 00:00:00 and 06:30:00 then I need it to say "yes" and if not then "no",

I also tried importing what you put and I get 'FALSE' error

Chris
 
Upvote 0
Hi Dave,

I change the greater than sign in K35 and that worked perfectly. Thank you so much for your help

Chris
consider
Time.xlsm
FGHIJK
3506-Sep-21 06:0806-Sep-21 06:0806-Sep-21 18:2012:12324.81No
3606-Sep-21 07:3906-Sep-21 07:3906-Sep-21 13:5706:18194.619Yes
3e
Cell Formulas
RangeFormula
I35:I36I35=IF(F35<>"",MOD(H35,1)-MOD(F35,1),"")
K35:K36K35=IF(MOD(F35,1)>=TIMEVALUE("06:30:00"), "Yes","No")


between a range of times
Time.xlsm
FGHIJK
3806-Sep-21 06:0806-Sep-21 06:0806-Sep-21 18:2012:12324.81Yes
3e
Cell Formulas
RangeFormula
I38I38=IF(F38<>"",MOD(H38,1)-MOD(F38,1),"")
K38K38=IF(AND(MOD(F38,1)>=TIMEVALUE("00:00:02"),MOD(F38,1)<=TIMEVALUE("06:30:00")), "Yes","No")
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,195
Members
452,616
Latest member
intern444

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