+ Reply to Thread
Results 1 to 13 of 13

Conditional & Contains & Array

  1. #1
    Registered User
    Join Date
    07-27-2016
    Location
    London, England
    MS-Off Ver
    Excel for Mac 2011, version 14.0.0
    Posts
    6

    Lightbulb Conditional & Contains & Array

    Dear members, i wonder if you may be able to assist:

    I am trying to have Excel identify contents of a target cell in same row, and then output a desired result.

    simple formula can handle this for a single target: "750W"

    =IF(ISNUMBER(FIND("750W",P2)), "750W", "FALSE")


    but what about:

    1) a more complex target, which may contain multiple components? (eg "750W"+"0.50"+"DC")
    2) whereby I want Excel to automatically string together the output it finds in the target cell:

    =IF(ISNUMBER(FIND("750W"AND/OR"0.50"AND/OR"DC",P2)), "CONCATENATE & INSERT VALUES FOUND", "FALSE")

    I'm guessing i need to create a list (array?) somewhere for Excel to look up a range of targets, but I have no idea how to concatenate the output results into a single cell

    any help gratefully received

  2. #2
    Registered User
    Join Date
    07-26-2016
    Location
    Torun, Poland
    MS-Off Ver
    2007/2010/2013
    Posts
    23

    Re: Conditional & Contains & Array

    Hi,

    you need to concatenate combinations that you are interested in and create from them separated list. Then use VLOOKUP to search for particular combionation in that list.
    Example in attachement. In this case, you are searching a group by combination of name, surname and town of a person (totally without sense, sorry :P).

    You can also create a column with concantenated values and use VLOOKUP for certain cell with this combination.
    Attached Files Attached Files
    Last edited by Feronen; 07-27-2016 at 07:59 AM.

  3. #3
    Registered User
    Join Date
    07-27-2016
    Location
    London, England
    MS-Off Ver
    Excel for Mac 2011, version 14.0.0
    Posts
    6

    Thumbs up Re: Conditional & Contains & Array

    Fantatsic - thank you very much Feronen

  4. #4
    Registered User
    Join Date
    07-27-2016
    Location
    London, England
    MS-Off Ver
    Excel for Mac 2011, version 14.0.0
    Posts
    6

    Re: Conditional & Contains & Array

    unfortunately this has not given me a practical solution, as your suggestion does not allow for the fact that inside the cell I am searching, the contained text may be part of a large text entry, i need to use FIND function somehow, within your solution?

    =VLOOKUP(FIND(DATA!$E$1&DATA!$F$1,P2,0),$B$1:$C$44,2,FALSE)

    this is my best attempt but returns hashtagVALUE!

    quite simply I have a column that contains variations of the following string, whereby the items inside quotation marks represent a single variant from a list of 6 variants: {"Round Cut - Carat”:”0.25","Round Cut - Clarity”:”if","Round Cut - Colour”:”d" }

    what i want is to output into another cell in the same row, and so forth and so on, is the content from inside the quotation marks, in this case: 0.25ifd
    Last edited by DominicAtelier; 07-28-2016 at 01:07 PM.

  5. #5
    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: Conditional & Contains & Array

    Feronen Sorry for off-topic interjection:

    Although there is no official rule regarding this behavior, we request that wherever possible both the question AND the answer be provided in substantive detail here within the thread. An attached workbook is an excellent aid for posing a question and offering a solution, but solely doing that with no in thread explanation makes it difficult for researchers to understand or consider the Q & A of this thread without downloading what may be a pointless doc to them, if they can do that at all. Doing that also hides the content from search engines so others may never benefit from this.

    I'm sure you understand, and we look forward to seeing you post your formulas/macros in your posts for the searching benefit of all.

    Thanks again for all your hard work here!
    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

  6. #6
    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: Conditional & Contains & Array

    DominicAtelier welcome to the forum

    I would suggest that you upload a small (clean) sample workbook (not a pic) of what you are working with, and what your expected outcome would look like.

    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.

  7. #7
    Registered User
    Join Date
    07-26-2016
    Location
    Torun, Poland
    MS-Off Ver
    2007/2010/2013
    Posts
    23

    Re: Conditional & Contains & Array

    FDibbins, thank you for kind advice, I am very new to this forum and didn't see all the consequences of my taciturnity :P. I will gladly adjust to this rule - it benefits us all

    DominicAtelier - When I return home, I will look for solution for you immediately, with proper explanation :D

  8. #8
    Registered User
    Join Date
    07-27-2016
    Location
    London, England
    MS-Off Ver
    Excel for Mac 2011, version 14.0.0
    Posts
    6

    Re: Conditional & Contains & Array

    @FDibbins Thanks for the advice on how to get the most out of the forum - much appreciated

    @Feronen I have uploaded a simplified example xlsx as suggested

    there are 3 tabs:

    SEARCH: here I have manually input my desired result (consider i have 5000+ rows of data to manipulate, this example shows only 4)

    MATCH: where the data is being pulled from

    COMBINATIONS: all combinations & matches required for reference

    Any help will be extremely gratefully received

    Dominic
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    07-26-2016
    Location
    Torun, Poland
    MS-Off Ver
    2007/2010/2013
    Posts
    23

    Re: Conditional & Contains & Array

    Okay, so here is what I managed to create:

    In your case, you cannot use VLOOKUP for searching combinations of certain values (for example "d" as a color index), because it is a part of a larger text in a cell. VLOOKUP can't find exact text in bigger text string.
    Solution? You have to extract text that you are interested in to another, sigle cells. For that, you have to use function for text extracion - MID:
    Please Login or Register  to view this content.
    You start in the SEARCH sheet. The problem is, the position of text we want to extract is variant, so we have to make formula more inteligent, using functions like FIND, LEN and SUBSTITUTE.
    First I had to replace some of "," signs in your entered text with some unique symbols. For that, I used SUBSTITUTE function to replace "," in the middle of text to "*" and "&" symbols in the column C ("Helper"). Why I did that?
    The explanation is the next step. For example colour symbol - it helps a lot, that your text has some pattern: before that information, there is always text "Colour". That gives me a start point to use in FIND function.
    But to find the end of a text I want to extract, symbols "," wouldn't be enough - there is too much of them. That is why I replaced some of them in a first place.
    Thanks to that, FIND function doesn't have a problem with finding it. So I extracted needed informations into single cells in colums D:G (Carats wasn't necessary).
    Final step - after an extraction of every information I need, I concantenated them into single string in column H and then used VLOOKUP in SEARCH sheet to look for values in MATCH sheet using combinations from COMBINATIONS sheet (I created that combination in colums REF_COMBINED).

    Hope, that solution Workbook will clarify what I said and hope that is what you needed

    You can also build whole formula in just one column, but displaying it in separate colums is more practical IMO, because you can use it later for another searches. In single column it would look like that:

    Please Login or Register  to view this content.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    07-27-2016
    Location
    London, England
    MS-Off Ver
    Excel for Mac 2011, version 14.0.0
    Posts
    6

    Re: Conditional & Contains & Array

    Hi Feronen, any chance you can have a look at this or shall I post a new thread in forum?

  11. #11
    Registered User
    Join Date
    07-26-2016
    Location
    Torun, Poland
    MS-Off Ver
    2007/2010/2013
    Posts
    23

    Re: Conditional & Contains & Array

    You missed my reply, check up

  12. #12
    Registered User
    Join Date
    07-27-2016
    Location
    London, England
    MS-Off Ver
    Excel for Mac 2011, version 14.0.0
    Posts
    6

    Re: Conditional & Contains & Array

    Quote Originally Posted by Feronen View Post
    Okay, so here is what I managed to create:

    In your case, you cannot use VLOOKUP for searching combinations of certain values (for example "d" as a color index), because it is a part of a larger text in a cell. VLOOKUP can't find exact text in bigger text string.
    Solution? You have to extract text that you are interested in to another, sigle cells. For that, you have to use function for text extracion - MID:
    Please Login or Register  to view this content.
    You start in the SEARCH sheet. The problem is, the position of text we want to extract is variant, so we have to make formula more inteligent, using functions like FIND, LEN and SUBSTITUTE.
    First I had to replace some of "," signs in your entered text with some unique symbols. For that, I used SUBSTITUTE function to replace "," in the middle of text to "*" and "&" symbols in the column C ("Helper"). Why I did that?
    The explanation is the next step. For example colour symbol - it helps a lot, that your text has some pattern: before that information, there is always text "Colour". That gives me a start point to use in FIND function.
    But to find the end of a text I want to extract, symbols "," wouldn't be enough - there is too much of them. That is why I replaced some of them in a first place.
    Thanks to that, FIND function doesn't have a problem with finding it. So I extracted needed informations into single cells in colums D:G (Carats wasn't necessary).
    Final step - after an extraction of every information I need, I concantenated them into single string in column H and then used VLOOKUP in SEARCH sheet to look for values in MATCH sheet using combinations from COMBINATIONS sheet (I created that combination in colums REF_COMBINED).

    Hope, that solution Workbook will clarify what I said and hope that is what you needed

    You can also build whole formula in just one column, but displaying it in separate colums is more practical IMO, because you can use it later for another searches. In single column it would look like that:

    Please Login or Register  to view this content.


    wow - that is some pretty serious formula work, i was miles off with my original attempt. Thank you so much Feronen, I did not expect the desired result would require so much work, you have been really very kind to help me this much, I am super grateful!

  13. #13
    Registered User
    Join Date
    07-26-2016
    Location
    Torun, Poland
    MS-Off Ver
    2007/2010/2013
    Posts
    23

    Re: Conditional & Contains & Array

    No problem at all Just make sure that my solution works in your real data sheet and mark thread as "Solved" if you don't need any help.

    If you liked this extended solution, you can click on "Add Reputation" icon near post with explanation. Much appreciated
    Last edited by Feronen; 08-01-2016 at 04:41 AM.

+ 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. Using an array and conditional formatting
    By seangun in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 04-18-2014, 07:57 AM
  2. [SOLVED] Conditional Formating with and Array
    By JimLau in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-01-2014, 08:04 PM
  3. Conditional sum on an array
    By jeffbannister in forum Excel General
    Replies: 2
    Last Post: 09-01-2011, 12:05 AM
  4. Conditional array
    By finmaster in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-20-2010, 08:05 AM
  5. Single Conditional Array x two Multi-Column Array - Approach needed
    By David Brown in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-28-2010, 11:41 AM
  6. Conditional sum - array?
    By laurafv in forum Excel General
    Replies: 0
    Last Post: 04-27-2010, 08:03 AM
  7. Conditional Array?
    By Pukka83 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-26-2008, 10:23 AM

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