+ Reply to Thread
Results 1 to 6 of 6

If Formula

  1. #1
    Registered User
    Join Date
    03-18-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    16

    Unhappy If Formula

    Hi,

    I am trying to get my excel sheet to tell me what quarter the dates are in,

    for example What quarter.xlsx

    Column A shows the date (yyyymm)
    Column B shows the hours worked
    Column C shows what quarter of hte year its in

    so i want
    d1 to equal 1 because its in the 1st quarter of the year
    d6 to return 2
    d13 to return 4 etc etc

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: If Formula

    Try in C2 and copy down.

    =IF(RIGHT(A2,2)+0<=3,1,IF(AND(RIGHT(A2,2)+0<=6,RIGHT(A2,2)+0>=3),2,IF(RIGHT(A2,2)+0>=10,4,3)))
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: If Formula

    well since they aren't real dates just text then
    =CEILING(RIGHT(A2,2),3)/3
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: If Formula

    another double post by me doh

  5. #5
    Registered User
    Join Date
    03-18-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: If Formula

    Thanks Fotis, works brilliantly

  6. #6
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: If Formula

    You are welcome but if i was you i should prefer to use Martin's(shorter) formula.

+ 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