Hi. I'm trying to fill 1 for the time between arrival and departure.

AliaNi

New Member
Joined
Oct 19, 2022
Messages
33
Office Version
  1. 2010
Platform
  1. Windows
I tried different formulas but they either work for some cases or don't work at all.

I entered the data in the first row manually.

1718912895091.png


Arrv Hour​
Dept Hour​
12:00 AM​
1:00 AM​
2:00 AM​
3:00 AM​
4:00 AM​
5:00 AM​
6:00 AM​
7:00 AM​
8:00 AM​
9:00 AM​
10:00 AM​
11:00 AM​
12:00 PM​
1:00 PM​
2:00 PM​
3:00 PM​
4:00 PM​
5:00 PM​
6:00 PM​
7:00 PM​
8:00 PM​
9:00 PM​
10:00 PM​
11:00 PM​
12:00 AM​
5:00 AM​
111111
12:00 AM​
12:00 PM​
12:00 AM​
5:00 AM​
12:00 AM​
5:00 AM​
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
When I used the formula you have with the data you pasted, I got incorrect results. Check that your times listed in row 1 and columns F and G are formatted as times. I used 24 hr time below and the formula worked.

2024-06-20.xlsx
FGHIJKLMNOPQRSTUVWXYZAAABACADAE
1Arrv HourDept Hour00:0001:0002:0003:0004:0005:0006:0007:0008:0009:0010:0011:0012:0013:0014:0015:0016:0017:0018:0019:0020:0021:0022:0023:00
200:0005:00111111000000000000000000
300:0012:00111111111111100000000000
400:0005:00111111000000000000000000
500:0005:00111111000000000000000000
Sheet2
Cell Formulas
RangeFormula
H2:AE5H2=IF(AND($F2<=H$1,$G2>=H$1),1,0)
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

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