H Hélio New Member Nov 23, 2015 #1 Hello, I would like to know how to determine if a time falls between a time range. I have a table with a group of events and need to put 1 everu time the time range falls inside a period.. Please see my table.. Attachments Excel quest.xlsx Excel quest.xlsx 9.2 KB · Views: 11
Hello, I would like to know how to determine if a time falls between a time range. I have a table with a group of events and need to put 1 everu time the time range falls inside a period.. Please see my table..
Chihiro Excel Ninja Nov 23, 2015 #2 I'm guessing A is Start? And also assuming it's not inclusive if end time falls exactly at 5:00 PM. In E2: =IF(AND(HOUR($A2)<=HOUR(E$1),MEDIAN($A2,$B2,E$1)=$A2),1,IF(AND($B2>E$1,MEDIAN($A2,$B2,E$1)=E$1),1,0)) Copy down and across. Attachments Excel quest_A.xlsx Excel quest_A.xlsx 12.7 KB · Views: 4
I'm guessing A is Start? And also assuming it's not inclusive if end time falls exactly at 5:00 PM. In E2: =IF(AND(HOUR($A2)<=HOUR(E$1),MEDIAN($A2,$B2,E$1)=$A2),1,IF(AND($B2>E$1,MEDIAN($A2,$B2,E$1)=E$1),1,0)) Copy down and across.
John Jairo V Well-Known Member Nov 23, 2015 #3 Hi @Hélio (and @Chihiro) You can use this formula in E2 and copy it down and right: =N(MEDIAN(INT($A2*24)/24,INT($B2*24)/24,E$1)=E$1) Blessings!
Hi @Hélio (and @Chihiro) You can use this formula in E2 and copy it down and right: =N(MEDIAN(INT($A2*24)/24,INT($B2*24)/24,E$1)=E$1) Blessings!
Chihiro Excel Ninja Nov 23, 2015 #4 Ah ha! Forgot that hour is represented by 1/24. To exclude where End time falls right on the hour. =N(IF($B2=E$1,0,MEDIAN(INT($A2*24)/24,INT($B2*24)/24,E$1)=E$1))
Ah ha! Forgot that hour is represented by 1/24. To exclude where End time falls right on the hour. =N(IF($B2=E$1,0,MEDIAN(INT($A2*24)/24,INT($B2*24)/24,E$1)=E$1))
John Jairo V Well-Known Member Nov 23, 2015 #5 Shorting a little the formulae: =N(INT(24*MEDIAN($A2,$B2,E$1)+10^-4)/24=E$1) =N(HOUR(MEDIAN($A2,$B2,E$1))=HOUR(E$1)) And with the idea of @Chihiro: =($B2<>E$1)*(INT(24*MEDIAN($A2,$B2,E$1)+10^-4)/24=E$1) =($B2<>E$1)*(HOUR(MEDIAN($A2,$B2,E$1))=HOUR(E$1)) Blessings! Last edited: Nov 23, 2015
Shorting a little the formulae: =N(INT(24*MEDIAN($A2,$B2,E$1)+10^-4)/24=E$1) =N(HOUR(MEDIAN($A2,$B2,E$1))=HOUR(E$1)) And with the idea of @Chihiro: =($B2<>E$1)*(INT(24*MEDIAN($A2,$B2,E$1)+10^-4)/24=E$1) =($B2<>E$1)*(HOUR(MEDIAN($A2,$B2,E$1))=HOUR(E$1)) Blessings!
H Hélio New Member Nov 24, 2015 #6 Hello team, all solutions fit for the question, I have tested all... many thanks.. You all are really masters on that!!! God bless you all...
Hello team, all solutions fit for the question, I have tested all... many thanks.. You all are really masters on that!!! God bless you all...