Calculating number of days from 2 date/time (mm/dd/yy hhmm format)

jandtng

New Member
Joined
Apr 17, 2024
Messages
16
Office Version
  1. 365
Platform
  1. Windows
The data I pulled comes out as " 06/10/24 1315 " format. (military time)
I'm able to calculate the number of days between 2 dates and time when the time has a colon, but I can't figure out how to calculate this without a colon.
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Assuming the entry is in A1

Case 1:
If this is formatted as text, you may use DATE(2000+mid(A1,7,2)*1, mid(A1,4,2)*1, left(A1,2)*1) to convert it into a date

The format is date(year,month,date)-
The above is assuming a DD/MM/YY format
In case it is MM/DD/YY, please swap the month/date portions within the DATE formula

Case 2:
If this already is a number, please use INT (A1)

Please do the same for the other entry where you need to do the conversion

A simple subtraction between the two will yield the result
 
Upvote 0
You can try inserting a colon and covert it to numeric type.
Book1
AB
2306/10/24 131506/10/24 13:15
Sheet5
Cell Formulas
RangeFormula
B23B23=--REPLACE(A23,LEN(A23)-1,0,":")
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

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