I need help with this formula; I am not familiar with its syntax

kctony

New Member
Joined
Apr 14, 2017
Messages
25
Office Version
  1. 365
Platform
  1. Windows
I have come across this formula to convert time but am unfamiliar with the syntax.
Can someone help decipher this for me?
Thanx
=TEXT(MOD(TEXT(S2,"00\:00")-TEXT(J2,"00\:00"),1),"HHMM")+0
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
It's for calculating time difference when the times are entered as 4 digit numbers instead of proper times. For example 1615 instead of 16:15

The second and third text functions convert the number to a valid time. The subtraction calculates the difference.
MOD is used so that times which cross midnight are calculated correctly.
The final text function shows the result in the same 4 digit format instead of proper time format.
Adding 0 at the end converts that resulting text string to a proper number.
 
Upvote 0
It's for calculating time difference when the times are entered as 4 digit numbers instead of proper times. For example 1615 instead of 16:15

The second and third text functions convert the number to a valid time. The subtraction calculates the difference.
MOD is used so that times which cross midnight are calculated correctly.
The final text function shows the result in the same 4 digit format instead of proper time format.
Adding 0 at the end converts that resulting text string to a proper number.
Thank you, that was very helpful
 
Upvote 0

Forum statistics

Threads
1,224,828
Messages
6,181,210
Members
453,023
Latest member
alabaz

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