Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Calculating with custom date format.

Posted on 2012-04-02
4
Medium Priority
?
293 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 1200 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This article describes a serious pitfall that can happen when deleting shapes using VBA.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

618 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