+ Reply to Thread
Results 1 to 4 of 4

[SOLVED] IF function with multiple scenarios-determining the current season

Hybrid View

  1. #1
    Registered User
    Join Date
    11-30-2009
    Location
    england
    MS-Off Ver
    Excel 2003
    Posts
    30

    [SOLVED] IF function with multiple scenarios-determining the current season

    Hello,

    I have 4 dates-21/3/10, 21/6/10,21/9/10 and 21/12/10. These are all the start of the seasons.

    I need a formula that can determine the current season (my boss requires it in a spreadsheet and considers it quite important ). I'm OK with usual IF functions but this one has 4 different outcomes and is a bit sticky. I have tried =IF(TODAY()<"21/3/10";"WINTER";"");IF(TODAY()>"21/3/10"<21/6/10";"SPRING";"" and this is as far as i tested but this didn't seem to work so i'm just wondering how to properly put this all together.


    Thanks guys
    Last edited by thewrathful; 04-14-2010 at 03:55 AM.

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: IF function with multiple scenarios-determining the current season

    You could set up a small table with your dates in A1:A4 (for example) and seasons in B1:B4. Then your formula would be
    =VLOOKUP(TODAY(),$A$1:$B$4,2,TRUE)
    If there was the possibility that today was before the value in A1, you'd need to include Jan 1,2010 as the first value (Winter) making it a 2 x 5 table. Make sense?

    If you really want to use IF statements, you'll need to express your dates as numbers, not strings and use the AND function.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097

    Re: IF function with multiple scenarios-determining the current season

    Hi,

    If you did want an if then perhaps

    =IF(TODAY()<DATE(YEAR(TODAY()),3,21),"Winter",IF(TODAY()<DATE(YEAR(TODAY()),6,21),"Spring",IF(TODAY()<DATE(YEAR(TODAY()),9,21),"Summer",IF(TODAY()<DATE(YEAR(TODAY()),12,21),"Autumn","Winter"))))
    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  4. #4
    Registered User
    Join Date
    11-30-2009
    Location
    england
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: IF function with multiple scenarios-determining the current season

    Works great-thanks guys!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1