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

knoharra

New Member
Joined
Dec 6, 2024
Messages
7
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: 14
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

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Excel formulas are not my thing so I can't help with those. I lean towards code.
 
Upvote 0

Forum statistics

Threads
1,224,845
Messages
6,181,301
Members
453,031
Latest member
Chris_1

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