+ Reply to Thread
Results 1 to 4 of 4

IF formula returning false positive

  1. #1
    Forum Contributor
    Join Date
    05-22-2012
    Location
    Boise, Idaho
    MS-Off Ver
    Office 365
    Posts
    156

    IF formula returning false positive

    I need help with a formula. I have attached a spread sheet. the formula is looking for specific text and if it has it in the cell then is should return a "Yes" otherwise a "No". I'm finding that sometimes I am getting a false positive and it says "Yes" when it should be a "No"

    Here are the two formulas

    =IF(ISNUMBER(SEARCH("COB*P*MA",C23)),"Yes","No")

    =IF(ISNUMBER(SEARCH("COB*P*MB",C23)),"Yes","No")

    Here is a sample of the data (each cell varies)

    DMG*D8*19521108*M~HD*030**HMO*SEGIP~DTP*348*D8*20210701~COB*S*MA*1~DTP*344*D8*20171101~NM1*IN*2*MEDICARE PART A~COB*S*MB*1~DTP*344*D8*20171101~NM1*IN*2*MEDICARE PART B~


    I have highlighted a couple cells that are returning wrong results. Cells B36 and B53. My concern is I have the same problem in column A as well just not spotting them.

    Thank you
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,802

    Re: IF formula returning false positive

    According to the help file (https://support.microsoft.com/en-us/...e-b6f54513b495 ), the SEARCH() function can use wildcard characters in the find_text argument. Of course, * is a very common wild card character that says to match any sequence of characters. In this case, it looks like you want to find "COB [any sequence of characters] P [any sequence of characters] MB", which it finds in those false positives.

    Since you have asterisks in column C, I expect you intend to search for the exact character string "COB*P*MB" -- not treating the asterisk as a wildcard character. As explained in the help file, if this is the case, precede each asterisk with a tilde -- =...SEARCH("COB~*P~*MB",C2)...

    Does that help, or did I misunderstand?
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Valued Forum Contributor
    Join Date
    06-23-2021
    Location
    Romania
    MS-Off Ver
    2021, 365 v 2208
    Posts
    722

    Re: IF formula returning false positive

    It happens because in the formula the star is viewed as a wildcard.
    * mean "any series of characters"
    If your text is "COB-blabla-P-blablabla-MA" the result is YES
    Diana Tanase


    If the solutions offered helped you to solve your problem, then mark the thread as SOLVED (thread tools in the top menu) and you can click on * to add reputation to those who helped you, as a way to say thank you !

  4. #4
    Forum Contributor
    Join Date
    05-22-2012
    Location
    Boise, Idaho
    MS-Off Ver
    Office 365
    Posts
    156

    Re: IF formula returning false positive

    Thank you for your help. The updates to the formula worked perfectly. Thanks

    =IF(ISNUMBER(SEARCH("COB~*P~*MA",C23)),"Yes","No")

    =IF(ISNUMBER(SEARCH("COB~*P~*MB",C23)),"Yes","No")

+ 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] Formula Returning False Instead Of Zero
    By lasc in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 12-11-2019, 06:11 PM
  2. Formula for returning only positive values from a range
    By Novosedoff in forum Excel Formulas & Functions
    Replies: 22
    Last Post: 12-28-2014, 05:08 PM
  3. [SOLVED] IF Formula returning False
    By tbutler09 in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 11-27-2013, 02:41 PM
  4. [SOLVED] SUMIF formula returning negative value & I need it to be positive
    By dosbirn in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 07-11-2013, 05:10 PM
  5. need one formula for returning positive or negative time w/out #######
    By completelyhis in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-11-2013, 09:12 AM
  6. formula returning false
    By sdts in forum Excel General
    Replies: 5
    Last Post: 12-10-2010, 06:35 AM
  7. formula using if and sum is returning false value.
    By hpcoolt in forum Excel General
    Replies: 4
    Last Post: 10-02-2009, 06:19 PM

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