+ Reply to Thread
Results 1 to 7 of 7

Nested IF and ISTEXT Statments

  1. #1
    Registered User
    Join Date
    09-16-2009
    Location
    Nashville, TN
    MS-Off Ver
    Excel 2003
    Posts
    30

    Nested IF and ISTEXT Statments

    Is there a way to shorten the following statements?

    =IF(AND(H5=0,K5>0),0,IF(AND(K5=0,H5>0),0,IF(AND(AND(H5=0,J5>0,K5=0)),0

    =IF(ISTEXT(E5),"TEXT ERROR",IF(ISTEXT(H5),"TEXT ERROR",IF(ISTEXT(K5),"TEXT ERROR"

    I need to add both to a much longer formula but then I exceed the maximum number of nested statments.

    Thanks,

    Kirk

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Nested IF and ISTEXT Statments

    Hi,
    Both your formulae are missing closing parentheses, and don't seem to have a default parameter. What I think you;re looking for are:

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    where "XX" is the default which you may or may not want to be '0'.

    Rgds
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    09-16-2009
    Location
    Nashville, TN
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: Nested IF and ISTEXT Statments

    Thanks Richard,

    I'm getting close to what I want with the following formula:

    =IF(AND(H5=0,K5>0),0,IF(AND(K5=0,H5>0),0,IF(AND(AND(H5=0,J5>0,K5=0)),0,IF(OR(OR(COUNTIF(E5,"*"),COUNTIF(H5,"*"),COUNTIF(K5,"*"))),"TEXT ERROR"

    However, when I enter text into cells I get a zero value instead of the "TEXT ERROR."
    how can I make this happen?

    Thanks again!!

    Kirk

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Nested IF and ISTEXT Statments

    Hi,

    It's not clear exactly what you're trying to do. The formula you post is still missing some closing parentheses, and you're still using IFs where I believe you can simplify with progressive AND(x=y,x=z) type statements as I mentioned in my previous post. All of which makes it difficult to read, particularly without seeing the formula in the context of its workbook.

    Upload the workbook and manually add several results that you expect to see as a result of data on the sheet, and add some notes as to how you've calculated them. We'll then stand a better chance of simplifying the thing.

    Rgds

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

    Re: Nested IF and ISTEXT Statments

    another way for text error would be
    =IF(ISERROR(E5+H5+K5),"text error","xx")
    "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

  6. #6
    Forum Contributor TechRetard's Avatar
    Join Date
    06-14-2009
    Location
    Houston, TX
    MS-Off Ver
    Excel 2010
    Posts
    202

    Re: Nested IF and ISTEXT Statments

    Quote Originally Posted by martindwilson View Post
    another way for text error would be
    =IF(ISERROR(E5+H5+K5),"text error","xx")
    you may want to use if error.type = 3 to be more specific

  7. #7
    Registered User
    Join Date
    09-16-2009
    Location
    Nashville, TN
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: Nested IF and ISTEXT Statments

    Richard and Martin,

    Both of these suggestions worked as I needed them to (actually, better). And I still have one IF statement available if needed.

    Richard, I believe I must have made a mistake in my copy and paste from your reply. Sorry about that.

    (This formula is part of a very elaborate monthly timesheet I’ve been creating. With the addition of these statements, this project is complete!)

    Thanks you both so much for your help!
    Kirk

+ 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