+ Reply to Thread
Results 1 to 12 of 12

IF Statement with ISBLANK function?

  1. #1
    Registered User
    Join Date
    08-24-2006
    Location
    Maryland
    Posts
    50

    IF Statement with ISBLANK function?

    Good Evening,

    I'm having some trouble getting my formula to do what I want it to do. I would like it to do the following:

    If C29 is "0" or "1", then return "25". If not, return "0".in cell C30

    My formula works great:

    =IF(AND(C29=0,C29<=1),25,IF(AND(C29>1),0))

    However, it is returning "25" when the C29 is left blank (which I do not want). I only want C30 to return a "25" if the value entered in C29 equals 1 or 0...any other value should return a "0"

    Is there an easy way to do this? I tried an ISBLANK, but I think my parentheses got messed up.

    Any help that you all could offer would be greatly appreciated!

    -Peace
    Last edited by Lmsloman; 07-02-2010 at 10:23 AM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: IF Statement with ISBLANK function?

    Based on the content of your question, the second IF() shouldn't be there at all. This formula will give 25 if C29 is 0, any value between 0 and 1 and is not blank, else it will display 0.

    =IF(AND(C29=0, C29<=1, NOT(ISBLANK(C29))), 25, 0)
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  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 Statement with ISBLANK function?

    =if(and(or(c29=0,c29=1),len(c29)=1),25,0)
    "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 Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: IF Statement with ISBLANK function?

    Or, for the really obtuse:

    =25*OR(C29={0,1})*LEN(C29)

    but I grant you - not very practical ;-)

  5. #5
    Registered User
    Join Date
    08-24-2006
    Location
    Maryland
    Posts
    50

    Re: IF Statement with ISBLANK function?

    Thank you so much for your help everyone! I haven't tried the second two suggestions, as the first one (from JBeaucaire) worked just fine for me

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: IF Statement with ISBLANK function?

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  7. #7
    Registered User
    Join Date
    08-24-2006
    Location
    Maryland
    Posts
    50

    Re: IF Statement with ISBLANK function?

    Thanks! I was trying to figure out how to do that....I haven't posted a question in a while

  8. #8
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211

    Re: IF Statement with ISBLANK function?

    =((c29=0)+(c29=1))*(c29<>"")*25

  9. #9
    Registered User
    Join Date
    02-28-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: IF Statement with ISBLANK function?

    To obtain your desired results, this will be your simplest way:

    Place this formula in cell C30

    Please Login or Register  to view this content.
    In the original post, the poster had used AND. This would have required that the cell be both = 1 and = 0. The poster wanted the result of "If C29 is "0" or "1", then return "25". If not, return "0".in cell C30"
    Last edited by Cadjine; 07-21-2013 at 05:31 PM. Reason: following posting rules

  10. #10
    Registered User
    Join Date
    02-28-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: IF Statement with ISBLANK function?

    This would not work. I am not sure I am following your logic.

  11. #11
    Registered User
    Join Date
    02-28-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: IF Statement with ISBLANK function?

    Did the original poster want any value between 0 and 1? I read the question to say 0 or 1.

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

    Re: IF Statement with ISBLANK function?

    well 2 years or so they might

+ 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