Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help Converting Date to Period

Status
Not open for further replies.

jimbolove

Instructor
Jun 26, 2006
8
0
0
US
Hi, can anyone offer assistance in changing the date to show as a Period. What I'd like to show is between 5/16 and 6/15 would be period 5. And then 6/16 to 7/15 would be Period 6 and so on it should be pretty easy to do I'm hoping.
 
Try this:
[tab][COLOR=blue white]=IF(DAY(A1)<=15,MONTH(A1),MONTH(A1)+1)[/color]

where A1 contains your date.

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ181-2886 before posting.
 
What application? For excel:
=MONTH(A1-15)

combo
 


John,

What happens between Dec 16 and year end?
[tt]
=IF(DAY(A1)<=15,MONTH(A1),MONTH(DATE(YEAR(A1),MONTH(A1)+1,1)))
[/tt]


Skip,
[sub]
[glasses] [red]Be Advised![/red] The only distinction between a bird with one wing and a bird with two, is merely...
a difference of A Pinion! [tongue][/sub]
 
I was tired. Work's been hectic. I wasn't concentrating.... The sun was in my eyes.

Sorry, jimbolove. My offering was unnecessarily complex and wrong on two counts.

[ul][li]For 5/16-6/15 it would give you 6, not 5 as you requested[/li]
[ul][li]I managed to confuse Skip ([small][gray]woo hoo[/gray][/small]) - his formula also has this flaw[/li][/ul]
[li]Also, as Skip pointed out, it would give you 13 at the end of the year, and that just doesn't make any sense at all[/li][/ul]

Go with combo's suggestion. It's short and sweet.

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ181-2886 before posting.
 


combo,

are you both short & sweet?

I'm confounded & curmudgeonly!

Skip,
[sub]
[glasses] [red]Be Advised![/red] The only distinction between a bird with one wing and a bird with two, is merely...
a difference of A Pinion! [tongue][/sub]
 
Skip,
no, I'm not. I'm either short or sweet. And I do not suggest anything!

combo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top