Formula problem

Stef9910

Board Regular
Joined
Nov 2, 2022
Messages
72
Office Version
  1. 2010
Platform
  1. Windows
Hi all,

I am having difficulties with a formula that should be easy!

Column T is titled End Time and has 16:06 in cell T15
Column R is titled Start Time and has 17:45 in cell R15

I would like to subtract the end time from the start time, but when I enter =T15-R15 it automatically enters =[@[End-[@[Start Time]] and excel says "The syntax of this name isn't correct"

I would also like the formula to return a 0 if there is no end date entered.

"=IF(ISERROR([@[End" did give me hours and minutes, but if there was no end date, it just displayed the start time.

Any Help will be greatly appreciated
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
How about:
=[@[End]]-[@[Start Time]]
or
=[@[End Time]]-[@[Start Time]]
???
 
Upvote 0
Not sure if this si what you are looking for.

=IF(ISBLANK([@[End Time]]),0,[@[End Time]]-[@[Start Time]])

1684831113615.png

1684831122827.png


If End date is blank then a 0 will be given (I have formatted the cells as Time, however general will give a 0 also)
 
Upvote 0
Not sure if this si what you are looking for.

=IF(ISBLANK([@[End Time]]),0,[@[End Time]]-[@[Start Time]])

View attachment 92125
View attachment 92126

If End date is blank then a 0 will be given (I have formatted the cells as Time, however general will give a 0 also)
This works a treat thank you, but i think i have it back to front the end time 16:06 and the start time is 17:45 and should result 22 hours and 21 minutes, when i swapped the end time and start time around for the minus part, it returns a lot of ##############
 
Upvote 0
This works a treat thank you, but i think i have it back to front the end time 16:06 and the start time is 17:45 and should result 22 hours and 21 minutes, when i swapped the end time and start time around for the minus part, it returns a lot of ##############
This would be due to the result being a negative number. So is the Result (End - Start = 22 hrs and 21 mins)?
 
Upvote 0
Try

Book2
ABCD
1
217:4516:0622:21
3
4
Sheet2
Cell Formulas
RangeFormula
C2C2=IF(B2="",0,IF(B2-A2<0,B2+1-A2,B2-A2))
 
Last edited:
Upvote 0
Solution

Forum statistics

Threads
1,215,466
Messages
6,124,983
Members
449,201
Latest member
Lunzwe73

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