Solved

Calculating with custom date format.

Posted on 2012-04-02
4
284 Views
Last Modified: 2012-04-02
Hi EE,

Help needed here. I use imported data where dates are expressed in this format:

yy.mm.dd

Example: 12.03.30

And I have pair of data, where I need to get the days between dates.

Example:

A1 = 12.03.12
A2 = 12.03.30

A2 - A1 = 18 days.

How to compute this in Excel?

Thanks.
0
Comment
Question by:capterdi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 81

Accepted Solution

by:
byundt earned 300 total points
ID: 37797429
In US Excel with dates all in year 2000 or later, the following formula works:
=SUBSTITUTE("20" & A2,".","/")-SUBSTITUTE("20" & A1,".","/")
0
 

Author Closing Comment

by:capterdi
ID: 37797444
Excellent.

Thanks.
0
 
LVL 81

Expert Comment

by:byundt
ID: 37797464
I wasn't sure if the formula would be working in Mexico--because you might be using a different default date format (dd/mm/yy).

The following formula should always work:
=DATE(LEFT(A2,2),MID(A2,4,2),RIGHT(A2,2))-DATE(LEFT(A1,2),MID(A1,4,2),RIGHT(A1,2))
0
 

Author Comment

by:capterdi
ID: 37797896
Both formulas have worked OK. I use english version of Excel.

Thanks.
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question