I have date time in the following format in Excel
say
A1 = Aug 14 2012 11:44AM
B1 = Aug 16 2012 3:19PM
I need to do subtract the time and report it in minutes. How can I do it in Excel.
I get #Value when I try =(B1-A1)*1440
Thanks!
I have date time in the following format in Excel
say
A1 = Aug 14 2012 11:44AM
B1 = Aug 16 2012 3:19PM
I need to do subtract the time and report it in minutes. How can I do it in Excel.
I get #Value when I try =(B1-A1)*1440
Thanks!
Welcome to the Forum!
subtract two datetimes to get minutes.xlsx
This works for me. I am guessing that you have text in those cells rather than actual date/time values. That will cause a #VALUE error. See my attachment for the correct way to do this.
Hi
I have attached the sample xlsx.
Thanks
Try,
=(SUBSTITUTE(TRIM(REPLACE(B1,LEN(B1)-1,0," "))," ",", ",2)-SUBSTITUTE(TRIM(REPLACE(A1,LEN(A1)-1,0," "))," ",", ",2))*1440
Regards,
Haseeb Avarakkan
__________________________________
"Feedback is the breakfast of champions"
Thank you so much that worked!
The data is presented in text form, and it's a date/time format that is not recognized and therefore not automatically coerced. The formula above solves your immediate problem (and maybe that's enough) but in general, date/time data should be entered as date/time data rather than text. The formula converts the existing data into date/time data by removing the leading space, adding a comma after the day number, and inserting a space before AM/PM. This method could be used to modify all your data. You would then have to reformat from General to a Custom format of "Mmm d, yyyy hh:mm AM/PM".
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks