+ Reply to Thread
Results 1 to 9 of 9

Wildcard in Excel is selecting full string instead of partial text.

  1. #1
    Registered User
    Join Date
    10-10-2017
    Location
    Manchester
    MS-Off Ver
    2016
    Posts
    6

    Wildcard in Excel is selecting full string instead of partial text.

    Hi Everyone,

    I'm having issues with using a wildcard in Excel.

    In a column I want to find values called "FFI".
    Within this column there is also a number of values called "Office".
    I've used two asterisks in my formula to surround "FFI", but it still includes the "Office" values, which contains the same combination of words.

    The issue is that the word "Office" contains the words "FFI" within it. The formula is including the cells containing 'Office' when it should only contain "FFI".

    The formula works in other cells in which it has to find partial text.

    My formula is below:

    =SUM(COUNTIFS(Pivot_Range[State],{"Active","Proposed"},Pivot_Range[Severity],"*4*",Pivot_Range[Tags],"*"& FFI &"*"))

    I always assumed this was the method to identify a partial text value, so any insight would be very helpful.

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Wildcard in Excel is selecting full string instead of partial text.

    Hi,

    That is indeed the method to match partial text. The issue is that "FFI" is part of the text of "Office", hence it matches. I don't understand the formula you posted though- is FFI also a named range?
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Wildcard in Excel is selecting full string instead of partial text.

    Hi Jriggerz,

    A sample of your data would be great to see..

    Is there a space before or after your "FFI"? Try
    =SUM(COUNTIFS(Pivot_Range[State],{"Active","Proposed"},Pivot_Range[Severity],"*4*",Pivot_Range[Tags],"* "& FFI &" *"))
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Registered User
    Join Date
    10-10-2017
    Location
    Manchester
    MS-Off Ver
    2016
    Posts
    6

    Re: Wildcard in Excel is selecting full string instead of partial text.

    FFI is a value within the same column, which is called 'Tags'. I slightly changed the formula in order to make it more understandable.

    This is the original:

    =SUM(COUNTIFS(Pivot_Range[State],{"Active","Proposed"},Pivot_Range[Severity],"*4*",Pivot_Range[Tags],"*"& C13 &"*"))

  5. #5
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,210

    Re: Wildcard in Excel is selecting full string instead of partial text.

    options are:
    is there a space before or after FFI if so match with the space as well "* FFI*" or "FFI *"
    add and extra condition <>"*Office*" unless office can appear in the same cell as FFI

  6. #6
    Registered User
    Join Date
    10-10-2017
    Location
    Manchester
    MS-Off Ver
    2016
    Posts
    6

    Re: Wildcard in Excel is selecting full string instead of partial text.

    I can't attatch any files unfortunately, I'm not allowed to at work . I'll paste a Markdown table below.

    This is the table I intend to put my results in:

    Please Login or Register  to view this content.
    This is the Pivot Table I'm using as my source:

    Please Login or Register  to view this content.
    There are also no spaces surrounding "FFI"

  7. #7
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Wildcard in Excel is selecting full string instead of partial text.

    It looks like FFI is always in capital letters, unlike Office? If that is always the case, you could use
    =SUMPRODUCT((Pivot_Range[State]={"Active","Proposed"})*(ISNUMBER(FIND("4",Pivot_Range[Severity])))*(ISNUMBER(FIND(C13,Pivot_Range[Tags]))))
    which will be case sensitive for all search values.

    Alternatively you might use an array formula
    =SUMPRODUCT((Pivot_Range[State]={"Active","Proposed"})*(ISNUMBER(FIND("4",Pivot_Range[Severity])))*(ISNUMBER(SEARCH(" "&C13&" "," "&Pivot_Range[Tags]&" "))))

  8. #8
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Wildcard in Excel is selecting full string instead of partial text.

    You could also use a Len() function and only select rows where the Length of the Tag field was 3 and FFI.

    From you example, why use wildcards at all. It looks like you simply want Tag = "FFI"


    =SUM(COUNTIFS(Pivot_Range[State],{"Active","Proposed"},Pivot_Range[Severity],"*4*",Pivot_Range[Tags],"FFI"))

  9. #9
    Registered User
    Join Date
    10-10-2017
    Location
    Manchester
    MS-Off Ver
    2016
    Posts
    6

    Re: Wildcard in Excel is selecting full string instead of partial text.

    xinitwits solution works perfectly, Thanks everyone for your help, it's greatly appreciated. I never thought it would have been this much trouble!

+ 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. Search and Match partial text string to full text and return a value
    By homa5424 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-09-2017, 10:52 AM
  2. [SOLVED] Counif in vertical list for 2 creterias looking for partial and full text inside cell
    By Sekars in forum Excel Formulas & Functions
    Replies: 20
    Last Post: 07-31-2017, 02:23 PM
  3. Replies: 5
    Last Post: 07-10-2017, 10:36 AM
  4. Match Full String into Partial String
    By krishns in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-27-2015, 05:04 PM
  5. VLOOKUP a full text in a partial data field
    By lukeareed in forum Excel General
    Replies: 3
    Last Post: 03-28-2014, 11:13 AM
  6. [SOLVED] Find partial text string within another text string return original text into cell.
    By mikey42979 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-17-2013, 02:58 PM

Tags for this Thread

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