Ask Experts Questions for FREE Help !
Ask
    walt17's Avatar
    walt17 Posts: 335, Reputation: 28
    Full Member
     
    #1

    Mar 12, 2013, 11:51 AM
    Compare dates in Excel
    I want to compare two dates to see if the time between them is greater or less than a set time. Is there a formula to do that?
    ebaines's Avatar
    ebaines Posts: 12,131, Reputation: 1307
    Expert
     
    #2

    Mar 12, 2013, 12:21 PM
    You can simply use subtraction and the result is the difference in days. If you want the difference in hours multiply by 24. So for example if cell A1 is "3/24/2013 10:13:00 AM," and cel lA2 is "3/12/2013 5:14:00 PM," then A1-A2 results in 11.7076 days. If you multiply that by 24 you get 280.98 hours.
    walt17's Avatar
    walt17 Posts: 335, Reputation: 28
    Full Member
     
    #3

    Apr 10, 2013, 12:05 PM
    Thanks for your response. Your method is easier than the way I was trying to do it. It has taken awhile to get back because I did encounter a problem.

    In a clean sheet, it works fine. As does my more complex method. But in the spreadsheet I'm using, neither method works. Even if I retype other data in the relevant rows, it's a no go. There is evidently some invisible coding that is fouling up the works, but I have been unable to find out what and correct it.

    Fortunately, this isn't a frequent calculation so I'll keep doing it manually when needed.
    ScottGem's Avatar
    ScottGem Posts: 64,966, Reputation: 6056
    Computer Expert and Renaissance Man
     
    #4

    Apr 10, 2013, 03:07 PM
    What version of Excel? There should be nothing to interfere with a formula like that? What results do you get?
    ebaines's Avatar
    ebaines Posts: 12,131, Reputation: 1307
    Expert
     
    #5

    Apr 11, 2013, 05:55 AM
    Also make sure that the cells are properly formatted as dates or numbers.
    walt17's Avatar
    walt17 Posts: 335, Reputation: 28
    Full Member
     
    #6

    Apr 12, 2013, 10:57 AM
    Quote Originally Posted by ebaines View Post
    Also make sure that the cells are properly formatted as dates or numbers.
    That was the key. Cells containing dates were properly formatted. But the results cell was formatted as text. Because that is what the ultimate answer will be. Changing results cell format to general makes it work.

    Thanks for the help.

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search


Check out some similar questions!

Excel Workbook - changing dates [ 3 Answers ]

I have a workbook for weekly timesheets... each week of the year has its own separate tab, and each tab has a "Week Of" cell on the worksheet. I didn't actually set this up, nor did I update last year's batch, but I think the person who did renamed each individual tab and Week Of cell. This will...

Compare related data stored in two or more excel sheets [ 18 Answers ]

How to compare related data stored in two or more different excel sheets? For example, annual sales figure of a number of companies relating to two OR more years available in different excel sheets? Either by grouping (pooling) the data into a single excel sheet or otherwise?

Search and compare in excel [ 3 Answers ]

In an Excel spreadsheet, I want to search for multiple matches based upon the entry in a cell. That is... Col A Col B Col C x x 1 y y 2 z 3 x 4 Using the...

How to compare Excel Lists with a free tool? [ 1 Answers ]

I need to compare Excel lists (1-3 columns) and isolate non-common list entries in a separate new list. Do you know of any tool that automatically performs this task and is free to use? One can usually search for such utilities by googling "Excel diff". Thank you in advance.


View more questions Search