+ Reply to Thread
Results 1 to 6 of 6

False error message, when using if

  1. #1
    Registered User
    Join Date
    10-05-2015
    Location
    Monterrey, Mexico
    MS-Off Ver
    MS Office 2013
    Posts
    2

    False error message, when using if

    Hello all,
    Hope you can help me what am I doing wrong with this formula,

    What I need in the formula is to count the number of characters in a cell and to return a message ("Review" or "OK") depending on the condition given.

    For example, if the cell A2 is specified as "hourly", then I need that the value in B2 is no longer than 9 characters and if so, C3 cell display "Review" or if B2 is shorter that 9 characters display "OK"

    This is the formula I'm using:

    =IF(A2="Hourly",IF(LEN(B2)>9,"Review",IF(LEN(B2)>6,"Review","OK")))

    It works when the cell A2 is specified as hourly, however, if A2 have any other value it displays a FALSE error, and what I need is that if A2 is not specified as hourly validate that B2 cell is not longer to 6 characters, and display "OK" or "Review" depending on the compliance of the condition

    Hope I made myslef clear,

    Thanks for your help

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.97.2 for Mac MS 365
    Posts
    8,711

    Re: False error message, when using if

    it almost sounds like you need an IF(AND statement instead...
    =IF(A2="Hourly",IF(LEN(B2)>9,"Review",IF(LEN(B2)>6,"Review","OK")))
    changed to =IF(AND(A2="Hourly",LEN(B2)>9),"Review",IF(LEN(B2)>6,"Review","OK")))
    (not tested though)
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

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

    Re: False error message, when using if

    First, FALSE isn't an error.. It's just the opposite of TRUE.

    Anyway, in your formula the False part of the first IF is omitted, so it just returns FALSE.
    If you want to see something else when A2 does NOT = Hourly, try

    =IF(A2="Hourly",IF(LEN(B2)>9,"Review",IF(LEN(B2)>6,"Review","OK")),"Something Else")

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    49,000

    Re: False error message, when using if

    One way:
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  5. #5
    Registered User
    Join Date
    10-05-2015
    Location
    Monterrey, Mexico
    MS-Off Ver
    MS Office 2013
    Posts
    2

    Re: False error message, when using if

    Thank you!,

    this is very useful information!, I'm not that much familiar with the "and" "or" functions, and they seem to work perfectly for this kind of scenarios.

    Appreciate the help
    Regards

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    49,000

    Re: False error message, when using if

    You're welcome.



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ 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] Remove "FALSE" error message from this formula please?
    By CatSqueezer in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-10-2013, 03:39 PM
  2. An error message on open - a totally blank VBA message box
    By Mr_Tigas in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-05-2013, 11:29 AM
  3. Strange FALSE pop-up message when macro runs... just started
    By trillium in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-27-2012, 08:33 PM
  4. Formula display problem (False message)
    By Creative19 in forum Excel General
    Replies: 3
    Last Post: 08-17-2011, 12:53 AM
  5. message box if all cells in range are false
    By adam2308 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-14-2009, 03:38 PM
  6. FALSE error message
    By pentatonic145 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-25-2007, 06:24 PM
  7. [SOLVED] False message .xla already open
    By RB Smissaert in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-12-2006, 04:25 AM

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