+ Reply to Thread
Results 1 to 3 of 3

Display 'UNKNOWN' in a cell if the criteria doesn't match

  1. #1
    Registered User
    Join Date
    10-15-2008
    Location
    Lincolnshire
    Posts
    53

    Unhappy Display 'UNKNOWN' in a cell if the criteria doesn't match

    If I enter a 7 digit number in to A1 I want '1' to be diplayed in B1, if a 5 digit number is entered in A1 I want '2' to be displayed in B1. Any other amount of numbers or text are to display 'UNKNOWN'.

    Please help.

  2. #2
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326
    Hi,
    use a combination of If and LEN functions

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Try:

    =If(Len(A1)=7,1,IF(Len(A1)=5,2,"Unknown))
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

+ 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