excelexcel-formula

Excel formula for calculating difference between two date columns


I have to 10k rows with two date columns. Can excel experts please provide an excel formula to calculate time difference(looking for diff in minutes) between below two date columns.

I have tried the formula =A1-B1 but its throwing #VALUE!

column A1 = 05/30/2019 21:16:48 +00:00

column B1 = 05/30/2019 21:10:28 +00:00


Solution

  • As mentioned in a comment by @Ron Rosenfeld, your times are just Strings and not true date/time values.

    If you can't alter the original data (with a find/replace to eliminate all the +00:00), then a simple SUBSTITUTE and your original subtraction should work. Also, multiply by 1440 to convert the result to minutes: 60 minutes/hour * 24 hours/day = 1440 minutes/day.

    =(SUBSTITUTE(A1," +00:00","")-SUBSTITUTE(B1," +00:00",""))*1440