How to change Date format to Double in Excel

Hello All,

In excel I have duration time format: 12:51:00 AM

I need to convert into 0:51, and I need to add the total sum of the column value.

Any Help!


Use this format for your cells:


(you might need to replace the β€œ;” by a β€œ,” the excessive localisation on microsoft tools drives me crazy)

Hello @msan,

Facing the issue Assign: Conversion from string β€œ0:51” to type β€˜Integer’ is not valid.

Hello @yogavalli,

Well, my understanding was about an issue in Excel. As you can see in the screenshot, with proper type you can use the sum function.

If your issue is about your VB code, 12:51:00 AM seems to be a DateTime string representation while you might want to use TimeSpan or Duration.


Once you have parsed the string Information into a dateTime you can retrieve the timespan by following:

and can use it for the additions

1 Like