+ Reply to Thread
Results 1 to 3 of 3

If Question-I get a blank answer

  1. #1
    Registered User
    Join Date
    08-03-2007
    Posts
    12

    If Question-I get a blank answer

    I have the statement =IF(B2="*NEW*",2,"")

    B2 = New Directory

    I get a blank answer, when the answer i want is 2, however if i were to do a countif(B2,"*NEW*") i get an answer of 1.

    So I am confused on how to search for just a specific part of a word or a cell, I thought you used **.

    any help on how my formula should be

    Thanks
    Last edited by grant862; 01-24-2008 at 09:23 PM.

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885
    Hi Grant,

    Wildcards only work with certain Excel functions in relation to text. The following formula doesn't need wildcards, and may work for you:
    Please Login or Register  to view this content.

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    You can't use wildcards with a comparison operator like = [the * are treated as literal *s]. As you suggest, you could use COUNTIF, e.g.

    =IF(COUNTIF(B2,"*NEW*"),2,"")

    or possibly

    =IF(COUNT(FIND("NEW",B2)),2,"")

    Note: FIND is case-sensitive, SEARCH and COUNTIF are not

+ 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