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
Hi!
Take a look at this.
Im sorry for the very rough estimate of the seasons. I have
only two seasons. im not familiar with 4 seasons. but more or less, this should do the trick.
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
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
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...
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.