+ Reply to Thread
Results 1 to 19 of 19

IF Function

  1. #1
    Registered User
    Join Date
    09-25-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    27

    IF Function

    Hi All,

    I just posted a thread in relation to gaining an IF formula and it is almost working however, having just one issue.

    =IF(OR(K2="YES",K2=" "),"N","Y")=IF(J2-I2>14,"Y","N")

    The above function is working however, instead of returning Y or N it returns False and True.

    Any ideas of how I can sort this?

    Thank You!
    Justin

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,645

    Re: IF Function

    Your formula:
    =IF(OR(K2="YES",K2=" "),"N","Y")=IF(J2-I2>14,"Y","N")
    Could be:
    ="Y"="Y" ==> TRUE
    ="N"="N" ==> TRUE
    ="Y"="N" ==> FALSE
    ="N"="Y" ==> FALSE
    Hoe does it could be "Y" or "N"?
    Quang PT

  3. #3
    Registered User
    Join Date
    10-22-2013
    Location
    Scotland
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: IF Function

    The first part of your formula is saying if K2 is blank or says yes then say no. Other wise say yes.
    The second part says if J2-I2 is greater than 14 then say yes, otherwise say no.

    I think you are missing another IF here. Do you want the formula to return true if the two halves equal each other and false if they don't?

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: IF Function

    It's hard to understand which conditions you want a Y or N...

    But taking a guess, try

    =IF(AND(J2-I2 < =14,OR(K2="YES",K2=" ")),"N","Y")

    If this isn't it, explain which conditions return Y or N...
    You have 2 basic conditions, with 4 possible combinations..

    1. K2 = Yes or " ", AND J2-I2 > 14
    2. K2 = Yes or " ", AND J2-I2 < = 14
    3. K2 DOES NOT = Yes or " ", AND J2-I2 > 14
    4. K2 DOES NOT = Yes or " ", AND J2-I2 < = 14

    Please show either Y or N for each of the 4 possible combinations of your conditions.

  5. #5
    Registered User
    Join Date
    09-25-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: IF Function

    Hi there, thank you for your time. I see what you're saying. Here are the conditions below.

    1. If K2 is "YES" then the cell must show "N", no matter what.
    2. If K2 is blank, I need the cell to query my other IF function.
    3. Other IF is - If the time between J2 - I2 is more than 14 days, the cell must show "N"
    4. if the time between J2 - I2 is less than 14 days, and K2 is blank, the cell must show "Y"

    Does the above make sense at all :S ?

  6. #6
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: IF Function

    Try

    =IF(K2="Yes","N",IF(J2-I2>14,"N","Y"))


    Technically, this doesn't test for K2 to be blank, instead it assumes it's blank if it is NOT "Yes"

  7. #7
    Registered User
    Join Date
    10-22-2013
    Location
    Scotland
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: IF Function

    What should it show if K is no?

  8. #8
    Registered User
    Join Date
    09-25-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: IF Function

    Where in the world do you get this wisdom? Works perfectly.

    Thank you Jonmo1! All rep given. Perfect.

    Have a good day

    Justin

  9. #9
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,645

    Re: IF Function

    So:

    =IF(K2="YES","N",IF(K2=" ",IF(J2-I2>14,"N","Y"),"What you need if K2 is not blank"))

  10. #10
    Registered User
    Join Date
    09-25-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: IF Function

    Is there a way of making it so if one of the J or I is blank, the cell is blank?

  11. #11
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: IF Function

    Try

    =IF(K2="Yes","N",IF(COUNT(I2:J2)=2,IF(J2-I2>14,"N","Y"),""))

  12. #12
    Registered User
    Join Date
    10-22-2013
    Location
    Scotland
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: IF Function

    =IF(K2="Yes","N",IF(OR(J2="",I2=""),"",IF(J2-I2>14,"N","Y")))

  13. #13
    Registered User
    Join Date
    09-25-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: IF Function

    Geniuses. Ok one last thing. Sorry to take advantage, but here goes.

    If M2 is above £0 i need the cell to display N.

    Also, if it is possible to have the above, if I put in 10%, it won't class that as more than £0 will it?

  14. #14
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: IF Function

    This is called "The bait and switch", and is generally frowned upon in these forums.
    It's best to lay out ALL of your expectations up front.

    But I'll go for one more....


    Is this new criteria "Above all others" ?
    If M2 is above 0, then "N"..Regardless of ALL the other conditions?

    =IF(M2>0,"N",IF(K2="Yes","N",IF(COUNT(I2:J2)=2,IF(J2-I2>14,"N","Y"),"")))

    And yes, 10% will be considered more than 0.
    0 is Nothing, 10% is indeed more than nothing.

  15. #15
    Registered User
    Join Date
    09-25-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: IF Function

    Ok actually think i managed the above: =IF(K2="Yes","N",IF(M2>0,"N",IF(COUNT(I2:J2)=2,IF(J2-I2>14,"N","Y"),"")))

    See any problems with that one? Is there anyway to only read currency and not class 10% as more than £1.00 ?

    Thanks again Rep+

  16. #16
    Registered User
    Join Date
    09-25-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: IF Function

    And I'm new to the forums. My aim wasn't to draw you in with Bait. I simply didn't realise the possibilities of Excel as to which you have assisted me with. I am sorry if you do not wish to answer but please do not feel the need to reply if you feel angered by my requests.
    Last edited by themanwithnoshoes; 10-22-2013 at 11:48 AM.

  17. #17
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: IF Function

    I'm not angry, as you see I went on to actually post a response to the new criteria..
    That was intended more as a friendly FYI about best practices when posting in the forum.


    Anyway..

    Not sure I follow what you're after with the 10%..
    10% is NOT more than £1.00, but it IS more than 0.

    You're testing the formula for M2>0, but then you're asking about more than £1.00 ??
    Can you clarify?

  18. #18
    Registered User
    Join Date
    09-25-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: IF Function

    Thanks for your help. Sorted.

  19. #19
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: IF Function

    You're welcome.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] IF Function referencing IsNumber, Match, Left function on separate sheets
    By Touch9713 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-12-2013, 10:09 PM
  2. [SOLVED] Using Offset function as the array in the PercentRank function is giving wrong result
    By Bobneil in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 08-06-2013, 09:29 PM
  3. Replies: 1
    Last Post: 03-21-2012, 11:22 AM
  4. Replies: 2
    Last Post: 03-20-2009, 01:29 PM
  5. [SOLVED] Excel - User Defined Function Error: This function takes no argume
    By BruceInCalgary in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-18-2006, 04:05 PM

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