+ Reply to Thread
Results 1 to 4 of 4

Get multiples values in table via expressions truncated in words

  1. #1
    Forum Contributor
    Join Date
    09-15-2022
    Location
    Marseille, France
    MS-Off Ver
    O365 (PC) V 2303
    Posts
    265

    Get multiples values in table via expressions truncated in words

    Dear All:

    I am trying to extract a list of values in a table, on a per row basis, following a procedure as follow:

    get value.jpg

    shall locate first within E2:W2, all labels which contain:
    - condition1
    - on the left of the label, before the first "_", the different possible values wich exist before "_configuration" (valueA, valueB , valueB2 etc.), for each row, in B3:B11
    - example: "valueC_configuration" in B3:B11, we would look after "valueC" types, so our selected labels in this first step will be: "valueC_data_suffix1" and "valueC_data_suffix2" (two matches)
    - notice: in B3:B11, there could be a single configuration value, or multiple, comma-separated, in which case we shall locate all corresponding labels in E2:W2
    - example: "valueA_configuration,valueB1_configuration" in B3:B11, here we look for "valueA" and "valueB1" types, this would return "valueA_data_suffix1", "valueA_data_suffix2" and "valueB1_data_suffix1" (three matches)
    - condition2
    - on the right of the label, after the last "_", any labels with "suffix" as a root (suffix1, suffix2, etc.)
    - it means that any root which is not "suffix" shall be excluded
    - example: "valueE_configuration" in B3:B11, here we look for "valueE" on the left (condition1) and "suffix" on the right (condition2), this would return "valueE_data_suffix1", "valueE_data_suffix2" (two matches), however "valueE_data_select1" would be excluded because of condition2
    then shall return the value(s) of the arrays of the selected labels, for the corresponding row:
    - if there is a single array (single label), then it has to be a single result
    - example, "valueG_configuration" woud lead to a single label "valueG_data_suffix3", this would return a single value, QCUQB
    - if there are multiple arrays, the results is as follow:
    -- if there are multiple suffixes for the same configuration, then we separate the results with a comma
    -- example, "valueC_configuration" (single configuration) woud return 2 suffixes, which we display as follow: UYBKS,JGUYV (separator: comma)
    -- if there are multiple configurations, then we separate such results with an hyphen
    -- example, "valueA_configuration,valueB1_configuration" (two configurations) woud lead to 1 suffix for the configuration1, and 2 suffixes for the configuration 2, which we display as follow: GFMLV,ZBWUK-GLPGU (separator: comma, then hyphen)


    Any help would be much appreciated. The file is attached. Thanks.
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,676

    Re: Get multiples values in table via expressions truncated in words

    This proposed solution adds two columns and a row, all of which may be hidden for aesthetic purposes.
    Row 1 is populated using: =IF(RIGHT(G2,7)="select1","",LEFT(G2,SEARCH("_",G2)-1))
    Column A is populated using: =IF(D3="","",LEFT(D3,SEARCH("_",D3)-1))
    Column B is populated using: =IF(OR(D3="",ISERROR(SEARCH(",",D3))),"",MID(D3,SEARCH(",",D3)+1,SEARCH("/",SUBSTITUTE(D3,"_","/",2))-SEARCH(",",D3)-1))
    The suffix column (E) is populated using**: =IF(D3="","",TEXTJOIN(",",1,IF(G$1:Y$1=A3,G3:Y3,"")))&IF(B3<>"","-"&TEXTJOIN(",",1,IF(G$1:Y$1=B3,G3:Y3,"")),"")
    ** Denotes an array entered formula which is not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).
    Note that array entry of this formula may not be necessary in the 365 version of Excel.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  3. #3
    Forum Contributor
    Join Date
    09-15-2022
    Location
    Marseille, France
    MS-Off Ver
    O365 (PC) V 2303
    Posts
    265

    Re: Get multiples values in table via expressions truncated in words

    Thank you JeteMc!

    Sorry for the delayed response I had a 1-week vacation. Thanks again.

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,676

    Re: Get multiples values in table via expressions truncated in words

    You're Welcome. Thank You for the feedback and for marking the thread as 'Solved'. I hope that you have a blessed day.

+ 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] Numbers to words help for UK/British expressions of currency amounts
    By tomca in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-25-2016, 02:24 PM
  2. Help needed with expressions with substring expressions.
    By sbell1234 in forum Access Tables & Databases
    Replies: 7
    Last Post: 06-21-2015, 02:59 PM
  3. Split text in single cell to multiples of 80 characters by full words
    By NotSwank in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-19-2014, 10:28 AM
  4. [SOLVED] Excel Table Requiring Blank Row For Expressions To Work
    By jcaynes in forum Excel General
    Replies: 6
    Last Post: 09-09-2013, 06:54 PM
  5. Working with words with regular expressions (replace)
    By Odeen in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-30-2012, 03:43 AM
  6. Why is my row truncated in a pivot table?
    By mcmunnd1 in forum Excel General
    Replies: 1
    Last Post: 10-11-2005, 05:05 PM
  7. Conditional Formating by truncated values....
    By JB2005 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-08-2005, 01:05 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