seasons from dates

robt123

New Member
Joined
Jan 9, 2003
Messages
20
Hi

I have a student who wants to type in a date in excel in the format 01/01/2004. He then wants excel to identify the season of the year in another cell depending on the month

Any ideas

Cheers and TIA

Rob
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Hi!
You copy the formula in column B. then type any date in column A. the formula in B will test the month in the column A and write the appropariate season.
this is the formula in B

Code:
=IF(OR(MONTH(A2)=12,MONTH(A2)<=2),"winter",IF(AND(MONTH(A2)>=9,MONTH(A2)<=11),"autumn",IF(AND(MONTH(A2)>=3,MONTH(A2)<=5),"Spring",IF(AND(MONTH(A2)>=6,MONTH(A2)<=8),"Summer"))))
 
Upvote 0
You can create following function

Function season(inputdate)
If (Month(inputdate) < 3) Or _
((Month(inputdate) = 3 And Day(inputdate) < 21)) Or _
((Month(inputdate) = 12 And Day(inputdate) > 20)) Then
season = "winter"
End If
If ((Month(inputdate) > 2 And Day(inputdate) > 20)) Or _
(Month(inputdate) = 4 Or Month(inputdate)) = 5 Or _
((Month(inputdate) = 6 And Day(inputdate) < 21)) Then
season = "spring"
End If
If ((Month(inputdate) > 6 And Day(inputdate) > 20)) Or _
(Month(inputdate) = 7 Or Month(inputdate)) = 8 Or _
((Month(inputdate) = 9 And Day(inputdate) < 21)) Then
season = "summer"
End If
If ((Month(inputdate) > 9 And Day(inputdate) > 20)) Or _
(Month(inputdate) = 10 Or Month(inputdate)) = 11 Or _
((Month(inputdate) = 12 And Day(inputdate) < 21)) Then
season = "autumn"
End If
End Function

now you have a funtion "season(input)"
 
Upvote 0
Just for the fun... take a look on other way...

Please note that thease solutions are of little resolution- namely based on whole month. It is much greater challenge to define sesons based on days e.g. from 21/10 - 25-3 = winter and so on. But it can be done.
Tell us if you need this kind of resolution...

Eli
Book1
ABCDE
101/01/04winterwinter
201/02/04winterspring
301/03/04wintersummer
401/04/04springautumn
501/05/04spring
601/06/04summer
701/07/04summer
801/08/04summer
901/09/04summer
1001/10/04autumn
1101/11/04autumn
1201/12/04winter
13
Sheet1
 
Upvote 0

Forum statistics

Threads
1,218,917
Messages
6,145,197
Members
450,601
Latest member
itsfarid

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top