Solved

Calculating with custom date format.

Posted on 2012-04-02
4
251 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
  • 2
  • 2
4 Comments
 
LVL 80

Accepted Solution

by:
byundt earned 300 total points
Comment Utility
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
Comment Utility
Excellent.

Thanks.
0
 
LVL 80

Expert Comment

by:byundt
Comment Utility
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
Comment Utility
Both formulas have worked OK. I use english version of Excel.

Thanks.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Drop Down List with Unique/Distinct Values (enhancing the Combo-Box with a few steps and a little code) David miller (dlmille) Intro Have you ever created a data validation list from a database field or spreadsheet column (e.g., Zip Codes or Co…
Dealing with unintended Excel Active-X resizing quirks (VBA code simulates "self correction") David Miller (dlmille) Intro Not everyone is a fan of Active-X controls in spreadsheets (as opposed to the UserForm approach, the older Form controls …
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

728 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now