+ Reply to Thread
Results 1 to 6 of 6

If statement trying to get Q1 2018, Q2 2018, Q1 2019, etc

  1. #1
    Forum Contributor
    Join Date
    05-02-2017
    Location
    NoVa, United States
    MS-Off Ver
    2010
    Posts
    108

    If statement trying to get Q1 2018, Q2 2018, Q1 2019, etc

    Okay, what I'm trying to do is come up with an IF statement (or if there's an easier way I'm open to that) to get the quarter and year of a date. So I want my IF statement to put out something like Q1 2018. Right now I have three columns - the 'date' and a column for the month derived from that date and a column for the year derived from that date.

    My formula, which doesn't work, looks like this:

    =IF(OR(B2="January"&C2=2018,B2="February"&C2=2018,B2="March"&C2=2018),"Q1 2018",IF(OR(B2="April"&C2=2018,B2="May"&C2=2018,B2="June"&C2=2018),"Q2 2018",IF(OR(B2="July"&C2=2018,B2="August"&C2=2018,B2="September"&C2=2018),"Q3 2018",IF(OR(B2="October"&C2=2018,B2="November"&C2=2018,B2="December"&C2=2018),"Q1 2018",""))))

    I tried to do an if statement with an 'and' and an 'or' but that really didn't turn out well....

    Any ideas?
    Attached Files Attached Files

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2003,2007,2010
    Posts
    29,855

    Re: If statement trying to get Q1 2018, Q2 2018, Q1 2019, etc

    Try:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Trevor Shuttleworth - Excel Aid

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2003,2007,2010
    Posts
    29,855

    Re: If statement trying to get Q1 2018, Q2 2018, Q1 2019, etc

    Oops, missed the year:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    05-02-2017
    Location
    NoVa, United States
    MS-Off Ver
    2010
    Posts
    108

    Re: If statement trying to get Q1 2018, Q2 2018, Q1 2019, etc

    .....

    My formula was ten million characters and didn't work.

    TMS's was a brilliantly short formula and totally works.

    I gotta up my excel game.

    Thanks TMS!

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2003,2007,2010
    Posts
    29,855

    Re: If statement trying to get Q1 2018, Q2 2018, Q1 2019, etc

    You're welcome. Thanks for the rep.



    To be fair, I picked it up from elsewhere and adapted it a tiny bit. Sometimes it just needs a step back and knowing what to Google For example, Google: excel formula to convert month to quarter

  6. #6
    Forum Contributor
    Join Date
    05-02-2017
    Location
    NoVa, United States
    MS-Off Ver
    2010
    Posts
    108

    Re: If statement trying to get Q1 2018, Q2 2018, Q1 2019, etc

    Knowing what to google is a good point. I try to use google as a resource, but sometimes I'm just not putting in the right words.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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