+ Reply to Thread
Results 1 to 7 of 7

Can't do basic date calculations

  1. #1
    Registered User
    Join Date
    10-14-2010
    Location
    BC Canada
    MS-Off Ver
    Excel 365
    Posts
    77

    Unhappy Can't do basic date calculations

    My knowledge of using dates in excel must be pretty close to zero.

    I've got a program that puts out dates in this format

    2/20/2023

    I want to be able todo a compare to see if these dates are before or after a particular day.

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    I understand I need to format the cell type in a way that excel recognizes that its a date, and the calculation will work out.

    From what I've read it should be simple....So i go into format cells and down to custom and create a custom type of "m/dd/yyyy". Which does not work.

    If someone could explain how this works that would be great,

    Thanks

    Jon


    ExampleDate.xlsx
    Last edited by thisandthat; 02-13-2024 at 01:20 PM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,853

    Re: Can't do basic date calculations

    There are instructions at the top of the page explaining how to attach your sample workbook (yellow banner: HOW TO ATTACH YOUR SAMPLE WORKBOOK). Screenshots are of little practical use as we cannot manipulate them.

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. It also has expected results mocked up, worked examples where required, relevant cells highlighted and a few explanatory notes.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: Can't do basic date calculations

    Excel will (should!) recognise 2/20/2023 as date with whatever format is used for the cell. See attached (UK format dates)
    Attached Files Attached Files
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  4. #4
    Registered User
    Join Date
    10-14-2010
    Location
    BC Canada
    MS-Off Ver
    Excel 365
    Posts
    77

    Re: Can't do basic date calculations

    Thanks,

    I've attached an example.

  5. #5
    Registered User
    Join Date
    10-14-2010
    Location
    BC Canada
    MS-Off Ver
    Excel 365
    Posts
    77

    Re: Can't do basic date calculations

    Quote Originally Posted by JohnTopley View Post
    Excel will (should!) recognise 2/20/2023 as date with whatever format is used for the cell. See attached (UK format dates)
    I just can't get it to recognize the 2/20/2023, the 2023-02-20 format works fine.

  6. #6
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Can't do basic date calculations

    Your cells contain text strings and not date serial numbers. Changing number format does not change anything about the underlying cell value, so they remain text.

    Common solutions for converting "numbers/dates stored as text" into real numbers: https://support.microsoft.com/en-us/...rs=en-us&ad=us

    If it helps, since my system is set to recognize MDY dates, I had not trouble using the Text to Columns command to convert the dates as text to real dates. Your file indicates that the text is being imported from the output of another program. You might look at the process you use to import these values and see if you can get Excel to correctly recognize these dates as part of that import process.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  7. #7
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    1,980

    Re: Can't do basic date calculations

    As you have 365, you can get the proper date value in the column headed "I removed the time" by using this formula.

    Please Login or Register  to view this content.
    Last edited by ByteMarks; 02-14-2024 at 11:26 AM.

+ 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. Basic Inventory Formula and Calculations
    By OGSS1217 in forum Excel General
    Replies: 1
    Last Post: 05-12-2023, 01:02 PM
  2. Replies: 2
    Last Post: 07-26-2018, 07:23 AM
  3. Basic Excel date formatting
    By cleggr in forum Excel General
    Replies: 5
    Last Post: 03-28-2013, 06:24 PM
  4. Date calculations - adding number of days to a date
    By Dave Goldman in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 03-12-2011, 12:44 PM
  5. Basic date question
    By trevorwilson in forum Excel General
    Replies: 1
    Last Post: 04-11-2008, 07:51 AM
  6. spread sheet calculations using visual basic
    By newdude in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-07-2007, 08:29 AM
  7. Date and time calculations and automatic date changes
    By Arlette in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-09-2006, 05:25 AM

Tags for this Thread

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