PC Review


Reply
Thread Tools Rate Thread

Conversion of dates

 
 
Vjee
Guest
Posts: n/a
 
      17th Dec 2007
Hello all,

I need to convert dates into periods in an excel sheet.

For example 1/1/2007 -> 28/1/2007 = P1
29/1/2007 -> 25/2/2007 = P2
....until P13 (13 periods of 4 weeks). So a period does not necessarily
match the number of the month. (eg. 20/12/2007 = P13)

If a cell for example says 10/1/2007 "P1" should be returned, if
25/12/2007 -> "P13", ...

I tried things like "=IF(1/1/2007<A1<28/1/2007; P1, ...)" but that
doesn't work.

thanks for your advice on this one !

Xavier
 
Reply With Quote
 
 
 
 
Mike H
Guest
Posts: n/a
 
      17th Dec 2007
One possible solution is with a table like this in my case in A1:B3

01/01/2007 P1
29/01/2007 P2
26/02/2007 P3

Note that the dates must be sorted ascending and are your transition dates
from 1 period to the next.
Then a formula
=VLOOKUP(C1,A1:B3,2,TRUE)
Where C1 is the date you want to convert

Mike


"Vjee" wrote:

> Hello all,
>
> I need to convert dates into periods in an excel sheet.
>
> For example 1/1/2007 -> 28/1/2007 = P1
> 29/1/2007 -> 25/2/2007 = P2
> ....until P13 (13 periods of 4 weeks). So a period does not necessarily
> match the number of the month. (eg. 20/12/2007 = P13)
>
> If a cell for example says 10/1/2007 "P1" should be returned, if
> 25/12/2007 -> "P13", ...
>
> I tried things like "=IF(1/1/2007<A1<28/1/2007; P1, ...)" but that
> doesn't work.
>
> thanks for your advice on this one !
>
> Xavier
>

 
Reply With Quote
 
Stephen
Guest
Posts: n/a
 
      17th Dec 2007
Make yourself a table with start dates for periods in the first column and
return values in the second. The dates should be in ascending order. Then
use VLOOKUP with the fourth parameter (range_lookup) as TRUE. (From Help:
"If TRUE or omitted, an approximate match is returned. In other words, if an
exact match is not found, the next largest value that is less than
lookup_value is returned.")

"Vjee" <(E-Mail Removed)> wrote in message
news:65b22d05-1e43-47a2-9907-(E-Mail Removed)...
> Hello all,
>
> I need to convert dates into periods in an excel sheet.
>
> For example 1/1/2007 -> 28/1/2007 = P1
> 29/1/2007 -> 25/2/2007 = P2
> ...until P13 (13 periods of 4 weeks). So a period does not necessarily
> match the number of the month. (eg. 20/12/2007 = P13)
>
> If a cell for example says 10/1/2007 "P1" should be returned, if
> 25/12/2007 -> "P13", ...
>
> I tried things like "=IF(1/1/2007<A1<28/1/2007; P1, ...)" but that
> doesn't work.
>
> thanks for your advice on this one !
>
> Xavier



 
Reply With Quote
 
Vjee
Guest
Posts: n/a
 
      17th Dec 2007
Works perfect !!

Thanks guys !
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dates-Conversion Lisa12 Microsoft Excel Worksheet Functions 11 2nd Jul 2008 03:44 PM
StupidSTUPID dates conversion question =?Utf-8?B?Q2xvdWRidXN0ZXI=?= Microsoft Access 1 1st Feb 2007 11:58 PM
Type Conversion Failure with dates =?Utf-8?B?SnVkeSBXYXJk?= Microsoft Access External Data 5 19th Aug 2006 07:40 PM
Problem with dates after conversion John Kleinbohl Microsoft Excel Discussion 2 9th Mar 2006 05:49 PM
How do I turn off the automatic conversion to dates? =?Utf-8?B?U3QgTGVtb24=?= Microsoft Excel Misc 1 21st Aug 2004 11:17 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:11 AM.