+ Reply to Thread
Results 1 to 5 of 5

Finding Contained Text within Multi-Faceted Formula

  1. #1
    Registered User
    Join Date
    10-08-2012
    Location
    BOS
    MS-Off Ver
    Excel 2011 Mac
    Posts
    15

    Finding Contained Text within Multi-Faceted Formula

    I am trying to pull specific data from a large data set. I am currently using a index/small/row function with multiple if statements. However, this is only giving me exact matches. For instance, if I am looking for "Aerospace" in cell A2, my current formula does not return a value with "Aerospace,Alcoholic Beverages" or any other non-exact match. Here is my formula that returns exact matches only:

    {=IF(AND(OR($A$2<>"-",$B$2<>"-"),OR($A$2<>"-",$C$2<>"-"),OR($B$2<>"-",$C$2<>"-"),OR($A$2<>"-",$B$2<>"-",$C$2<>"-")),">1 Ind",IF(AND($A$2="-",$B$2="-",$C$2="-"),"Ind?",IF($A$2<>"-",INDEX('Q4 ''11'!$A$1:$H$10000,SMALL(IF('Q4 ''11'!$A$1:$H$10000=$A$2,ROW('Q4 ''11'!$A$1:$H$10000)),ROW(1:1)),1),IF($B$2<>"-",INDEX('Q4 ''11'!$A$1:$H$10000,SMALL(IF('Q4 ''11'!$A$1:$H$10000=$B$2,ROW('Q4 ''11'!$A$1:$H$10000)),ROW(1:1)),1),INDEX('Q4 ''11'!$A$1:$H$10000,SMALL(IF('Q4 ''11'!$A$1:$H$10000=$C$2,ROW('Q4 ''11'!$A$1:$H$10000)),ROW(1:1)),1)))))}

    The A2 - C2 references are drop-down menus. My version of Excel doesn't allow for the number of drop down menus that I need. That's why I need the if statements.

    I have a few formulas on hand to find non-exact matches, but I can't seem to integrate them. Hopefully, this will make an answer more readily available:

    IF(--(COUNTIF('xxx'!J23,"*yyy.com/user*")>0)=1
    IFERROR(FIND($D$1,A1),0)>0
    IF(FIND($A$2,'Q4 ''11'!$H2)=1,$A$2,0)

    Any help is appreciated.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Finding Contained Text within Multi-Faceted Formula

    Nuggetross, welcome to the forum

    To best describe or illustrate your problem you would be better off attaching a dummy workbook. The workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    10-08-2012
    Location
    BOS
    MS-Off Ver
    Excel 2011 Mac
    Posts
    15

    Re: Finding Contained Text within Multi-Faceted Formula

    FDibbins and others, please see the attachment.
    Attached Files Attached Files

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Finding Contained Text within Multi-Faceted Formula

    If I have understood - perhaps you could modify to something along the lines of the below ?

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


    The use of pre-emptive "n/a" is to simply avoid calculating Array unnecessarily as it is inefficient to do so.

    To further improve performance you might consider using

    a) dynamic (non-volatile) named ranges
    b) couple of helper cells to store repetitive calcs

  5. #5
    Registered User
    Join Date
    10-08-2012
    Location
    BOS
    MS-Off Ver
    Excel 2011 Mac
    Posts
    15

    Re: Finding Contained Text within Multi-Faceted Formula

    This has worked great! One question, however. How would I include dynamic ranges with these formulas? Specifically, I am talking about Column D in Sheet2 of the file above. This is the current formula:

    {=IF($L4="N/A","N/A",IFERROR(CHOOSE(COUNTIF($B$2:$D$2,"-")+1,{1,2,3,4},"Ind?",INDEX('Q4 ''12'!$A:$A,SMALL(IF(ISNUMBER(SEARCH(SUBSTITUTE($B$2&$C$2&$D$2,"-",""),'Q4 ''12'!$H$2:$H$10000)),ROW('Q4 ''12'!$A$2:$A$10000)),ROWS(L$3:L5))),"<1 Ind",">1 Ind"),"N/A"))}

    When I replace 'Q4 ''12'!$A$2:$A$10000 with a dynamic range defined as: =OFFSET('Q4 ''12'!$A$2,0,0,MATCH("*",'Q4 ''12'!$A:$A,-1),1)
    ...and when I replace 'Q4 ''12'!$H$2:$H$10000 with a dynamic range defined as: =OFFSET('Q4 ''12'!$H$2,0,0,MATCH("*",'Q4 ''12'!$H:$H,-1),1)
    ...this causes the formula to work in D3 but not in any of the subsequent rows. The formula is not finding the next solution, but keeps repeating the same one over and over.

+ 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