+ Reply to Thread
Results 1 to 4 of 4

Receiving error when doing a simple date & time subtraction

  1. #1
    Registered User
    Join Date
    06-18-2020
    Location
    Arizona
    MS-Off Ver
    Office 365
    Posts
    75

    Receiving error when doing a simple date & time subtraction

    Hi all,

    I receive a "Modified On must be in the correct date and time format" when I attempt to subtract the 'created on' column from 'modified on' column. I am not sure why I am getting this error. The date format is the same for both columns. I am simply attempting to calculate the elapsed time between the two by using a basic subtraction formula, =(cell1-cell2)*1440.

    Thanks!
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by cph020283; 11-24-2020 at 08:49 PM.

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: Receiving error when doing a simple date & time subtraction

    Column C is setting with Datavalidation that only allow date >1.
    You may try to get minute? then remove the datavalidation.
    Attached Images Attached Images
    Quang PT

  3. #3
    Registered User
    Join Date
    06-18-2020
    Location
    Arizona
    MS-Off Ver
    Office 365
    Posts
    75

    Re: Receiving error when doing a simple date & time subtraction

    Is there a way to do it without data validation? When I attempt your suggestion it gives a value but it's not what I think is accurate. Also, i am unable to edit the 1440 to any other value, or even remove it without getting the same error. For example, in row 2 I get a result of 1:25:12 but in reality it's only a 4 minute difference. What am I perhaps missing?

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,557

    Re: Receiving error when doing a simple date & time subtraction

    As bebo states the issue seems to be with the data validation rule that is applied to Table1[Column 1]
    Select cell C2 and then select data validation.
    Select Apply these changes to all other cells with the same settings
    Select Clear All
    Select OK
    Now put the following formula into cell C2, set formatting to general and copy down (if auto correct options doesn't do that automatically):
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Receiving Various Run Time Errors On A Simple Piece of Code
    By HarryGreenwood in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-04-2015, 12:34 PM
  2. [SOLVED] Keep receiving Run-time error '1004': Application-defined or object-defined error
    By BladeAP in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-23-2014, 04:24 PM
  3. [SOLVED] I can't figure out why I am receiving a run time error '91'?
    By redsab in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-11-2014, 05:29 PM
  4. Military date time group subtraction
    By elothian in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 12-08-2013, 05:59 AM
  5. [SOLVED] Formula Tracking Time In Military Format - Receiving Error
    By DDM64 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-22-2013, 05:24 AM
  6. Date and time subtraction in excel 2003
    By hu2sain in forum Excel - New Users/Basics
    Replies: 8
    Last Post: 11-01-2012, 01:30 AM
  7. Date Subtraction/Time between Occurences
    By Losse in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-15-2005, 01:32 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1