+ Reply to Thread
Results 1 to 3 of 3

Formula help requiring two variables

  1. #1
    Registered User
    Join Date
    09-10-2012
    Location
    england
    MS-Off Ver
    Excel 2003
    Posts
    2

    Formula help requiring two variables

    Is anyone good at formula's for Excel. I have been struggling with one for about half a hour now (not used formulas in a long time and only to a basic level)

    Basically I want a formula that will tell me if cell A is X or Y and then if its X if the date in cell B is 3 years ago but if its Y it needs to tell me if its 5 years ago. Is this possible?

    So far I have only got a formula using the AND function that will tell me if Cell A is X or Y and if it is 3 years ago.
    Last edited by isimba; 09-10-2012 at 10:47 AM.

  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: Formula help requiring two variables

    Maybe

    =IF(AND(A1="X",(YEAR(TODAY())-YEAR(B1))=3),"OK",IF(AND(A1="Y",(YEAR(TODAY())-YEAR(B1))=5),"OK",""))
    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
    Registered User
    Join Date
    09-10-2012
    Location
    england
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Formula help requiring two variables

    =OR(AND(K52<=DATE(2009,10,30),L52="X"),AND(K52<=DATE(2007,10,30),L52="Y"))

    This is what I have come up with and seems to work. Thanks for the help though!

+ 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