Need to find time difference between most recent time listed in a column

knoharra

New Member
Joined
Dec 6, 2024
Messages
11
Office Version
  1. 365
Platform
  1. Windows
I am trying to calculate the time difference between 2 cells in time column A, but only if the time slot cell in Column B is used. See screenshot below of Columns A&B, assuming the top left is cell A1. For example, B4 (13:30) correctly shows 13h and 30 min between cells a4 & a3 times. However, in cell b11 (1:00) I want to calculate 4:00 (4h between 12pm in a11 and 8am in a4). How can I do this? Currently I am just using an if function referring to another cell to return a value or "-". If needed I am ok with changing the "-" to "#N/A" and I am able to do this, I just thought the "-" was cleaner looking. Thank you.
 

Attachments

  • Screenshot 2024-12-06 144044.png
    Screenshot 2024-12-06 144044.png
    5.6 KB · Views: 19
Ok so I'm realizing this isn't always working as intended. I've attached some minisheets to help. My plan is to look




Schedule Makeup New.xlsm
ABC
1Time/FieldField 1Field 2
29/12/25 6:00 PMU08 Boys Blue, A vs C0
39/12/25 6:15 PM00
49/12/25 6:30 PM0U08 Boys Blue, B vs D
59/13/25 8:00 AMU08 Boys Blue, D vs AU08 Boys Blue, B vs C
69/13/25 11:00 AMU08 Boys Blue, A vs B0
79/14/25 8:00 AM0U08 Boys Blue, C vs D
89/14/25 10:00 AMU08 Boys Blue, 1st vs 2nd0
MasterChart
Cell Formulas
RangeFormula
B1:W1B1=TRANSPOSE(Field[Field])
A2:A8A2=SORT(Time[Combined])
B2:C8B2=IFERROR(TEXTJOIN({", "," vs "},TRUE,CHOOSECOLS(FILTER(MasterSchedule!$A$6:$E$505,(MasterSchedule!$D$6:$D$505=B$1)*(MasterSchedule!$E$6:$E$505=$A2)),1,2,3)),0)
Dynamic array formulas.



Cell Formulas
RangeFormula
A53A53=A1
B53:C53,A54:A60B53=IF(ISBLANK(B1),"",B1)
B54:C60B54=IF(B2=0,"-",$A2-IFERROR(LOOKUP(9^9,B$53:B53,$A$53:$A53),$A53))
Named Ranges
NameRefers ToCells
_FilterDatabase=MasterChart!$A$1:$W$50A53


Schedule Makeup New.xlsm
ABCD
1FieldSizeMinBetween (Prelim)MinBetween (Final)
2Field 17v76575
3Field 211v117595
Fields
Cell Formulas
RangeFormula
C2:C3C2=IFS(OR(B2="7v7",B2="9v9"),65,B2="11v11",75)
D2:D3D2=IFS(B2="7v7",75,B2="9v9",85,B2="11v11",95)
Cells with Data Validation
CellAllowCriteria
B2:B3List7v7,9v9,11v11
 
Upvote 0

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Excel formulas are not my thing so I can't help with those. I lean towards code.
 
Upvote 0
Sorry, I am not following well enough.
Ultimately I'm trying to report the start time between games. However, since it's a master range of all possible start times, I can't simply subtract the time from the previous time block as there may not have been a game on that field during that time. I need to subtract from the last start time on the field in that column. Then conditionally format any results that are less than a referenced amount of time based on the game length. I think I've got it working now, but haven't confirmed with a fully completed schedule. I'll try likely late August 2025. My formulas follow...

B54:
=IFERROR(IF(B2="-","-",$A2-TAKE(FILTER($A$1:$A1,(B$1:B1<>"-")),-1)),"1st game on "&B$53)


Conditional formatting in B54:
=(B54+0.0001)<IF(OR(ISNUMBER(FIND("1st",B1)),ISNUMBER(FIND("2nd",B1)),ISNUMBER(FIND("5th",B1)),ISNUMBER(FIND("Div",B1)))=TRUE,INDEX(Fields!$A$2:$D$50,MATCH(B$53,Fields!$A$2:$A$50),4)/1440,INDEX(Fields!$A$2:$D$50,MATCH(B$53,Fields!$A$2:$A$50),3)/1440)


Note in conditional I had to add a few seconds to my result b/c in a few instances rounding seemed to make it falsely format cells right at the acceptable time limit.
 
Upvote 0
Solution

Forum statistics

Threads
1,225,772
Messages
6,186,937
Members
453,391
Latest member
patricktoulon1

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