+ Reply to Thread
Results 1 to 4 of 4

IF AND formula/function problem

  1. #1
    Registered User
    Join Date
    06-08-2011
    Location
    Worcester
    MS-Off Ver
    Excel 2003
    Posts
    10

    IF AND formula/function problem

    Can anyone help me as I have been going around in circles trying to solve this problem!

    I have a cell in worksheet1 (Cell ref S7) which is either blank or has a "Y" input

    On worksheet 2 in cell ref AO7 I need a function that will firstly check if worksheet1 cell has a "Y" if not then return 0, if "Y" then check if worksheet2 cells J7 AND K7 is > 0 , if both are > 0 return a 0. If J7 is > 0 and K7 = 0 then return value in cell AO2, if J7 = 0and K7 > 0 then return value in cell AO2

    Hope this explains what I mean.

    Thanks

  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 AND formula/function problem

    Try

    =IF(Sheet1!S7<>"Y",0,IF(AND(Sheet2!J7>0,Sheet2!K7>0),0,IF(AND(Sheet2!J7>0,Sheet2!K7=0),Sheet2!AO2,IF(AND(Sheet2!J7=0,Sheet2!K7>0),Sheet2!AO2))))
    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
    Valued Forum Contributor
    Join Date
    05-08-2012
    Location
    Georgia, USA
    MS-Off Ver
    Excel 2003, 2010
    Posts
    811

    Re: IF AND formula/function problem

    Assume S7 is the cell to be checked:

    =IF(Sheet1!S7<>"Y",0,IF(AND(Sheet2!J7>0,Sheet2!K7>0),0,IF(OR(AND(Sheet2!J7>0,Sheet2!K7=0),(AND(Sheet2!J7=0,Sheet2!K7>0))),AO2,"")))

    You do notice that you have two tests with the same result
    If J7 is > 0 and K7 = 0 then return value in cell AO2, if J7 = 0 and K7 > 0 then return value in cell AO2
    Click on star (*) below if this helps

  4. #4
    Registered User
    Join Date
    06-08-2011
    Location
    Worcester
    MS-Off Ver
    Excel 2003
    Posts
    10

    Thumbs up Re: IF AND formula/function problem

    Many thanks for the answers guys. I can now see where I was going wrong.

+ 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