[excel] season based on a date?!
jil
-
kirika -
kirika -
Hello,
I have an Excel file with a "date" column in the format dd.mm.yyyy
and I would like it to return in a "season" column the season based on my preferences:
if the month is between [December and February] -> winter
if the month is between [June and August] -> summer
if the month is between [September and October] -> autumn
for now I have this but it doesn't give anything:
I can't seem to nest my three "if" conditions...
I have an Excel file with a "date" column in the format dd.mm.yyyy
and I would like it to return in a "season" column the season based on my preferences:
if the month is between [December and February] -> winter
if the month is between [June and August] -> summer
if the month is between [September and October] -> autumn
for now I have this but it doesn't give anything:
=AND(IF(OR(MONTH(C2)=12;MONTH(C2)<=3);"winter";"");IF(OR(MONTH(C2)>=6;MONTH(C2)<=8);"summer";""); IF(OR(MONTH(C2)>=9;MONTH(C2)<=10);"autumn";"error"))
I can't seem to nest my three "if" conditions...
5 answers
-
Hello,
=CHOOSE(MATCH(MONTH(A1)*100+DAY(A1),{0;320;621;922;1221},1),"winter","spring","summer","autumn","winter")
with {0;320;621;922;1221} which are your mmdd (month day) season change dates:
03/20;06/21;....
Put in the dates that interest you, but you have a strangely placed winter...
eric
Never reply to an unsolicited DM...
Well, that's done. -
Hello,
the formula is incorrectly stated. This would surely be better:
=IF(OR(MONTH(C2)=12;MONTH(C2)<=3);"winter";IF(OR(MONTH(C2)>=6;MONTH(C2)<=8);"summer";IF(OR(MONTH(C2)>=9;MONTH(C2)<=10);"fall";"error")))
Best regards.
--
This guy wasn't very bright, as he was foolish. -
Hello,
To see:
https://www.cjoint.com/?BCml1XF6ci9
Best regards
--
“Life is like a box of chocolates, you never know what you're gonna get.” -
Thank you for your lightning-fast response! :)
The chossette9 formula seems to work very well.
Lentzouille2's idea is also good, but unfortunately I am in an absolutely huge database and adding columns is out of the question.
Then these responses will be useful for others besides me anyway ;) -
Good evening,
I have the same question, unfortunately my breakdown is not by month but in the middle of the month:
Winter: between 03/01/2013 and 15/03/2013
Spring: between 16/03/2013 and 15/05/2013
etc.
So the function with the months is no longer relevant, and I haven't managed to find the trick with the extreme dates of each season...
I'm still searching the internet, if I find anything by then I'll post the answer for others who are looking too!
Thank you for your response!