简体   繁体   中英

Convert time to milliseconds in Excel

I am trying to convert something in the following format to seconds.

Across the first row I have: Year, Month, Day, Hour, Minute, Seconds Second row I have for example: 2011, 07, 06, 20, 37, 06

How would I convert this to a single cell that specifies the number of total seconds that number is equal to. Keep in mind that different months have different number of days.

Lets say you have your values in row 2 and your reference date in G1, then this formula

=((DATE(A2,B2,C2)+TIME(D2,E2,F2))-G1)*24*60*60

should give you the desired result

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM