+ Reply to Thread
Results 1 to 5 of 5

Combination of strings in 1 cell based on word found on multiple rows in table

  1. #1
    Registered User
    Join Date
    05-09-2017
    Location
    Malmo, Sweden
    MS-Off Ver
    2010
    Posts
    2

    Question Combination of strings in 1 cell based on word found on multiple rows in table

    Hi!

    I don't know much about Excel but I need a specific formula if you wouldn't mind helping me..

    I need Excel to check if E5 or F5 or G5 or ... M5 in sheet 1 contains the same string as A5 in sheet 2.
    If it does, I want excel to take the value of B5 in sheet 1 and put it in D5 in sheet 2.
    Then I want Excel to check if E6 or F6 or ... M6 in sheet 1 contains the same string A5 in sheet 2 as before.
    If it does, I want excel to take the balue of B6 in sheet 1 and put it in D5 in sheet 2 again,
    with a ", " seperating the two different words from B5 and B6 in sheet 1.
    And then I need Excel to be able to do this about 500 more times, all in D5 in sheet 2.
    And then I want the same thing for D6 in sheet 2, starting at row 5 in sheet 1 again.

    So, for example if A5 in sheet 2 = "Cream",
    the formula I'm looking for should find all rows containing "Cream" in the table E5:M500 in sheet 1
    and note whatever is in column A of each row containing "Cream" in sheet 1
    and the result should be printed at D5 in sheet 2 like "Budapest, Napoleon, Princess, Semla, ..."
    and any other cakes or whatever that would contain cream.

    I've attached my file, if that helps.
    Attached Files Attached Files

  2. #2
    Forum Expert tim201110's Avatar
    Join Date
    10-23-2011
    Location
    Russia
    MS-Off Ver
    2016, 2019
    Posts
    2,357

    Re: Combination of strings in 1 cell based on word found on multiple rows in table

    =IFERROR(INDEX(Blad1!$B$5:$B$603,SMALL(IF(Blad1!$E$5:$X$603=$A5,ROW(Blad1!$E$5:$X$603)),COLUMNS($D$1:D$1))-4),"")
    Attached Files Attached Files

  3. #3
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Combination of strings in 1 cell based on word found on multiple rows in table

    Try to manually put in some mock results so that helpers can see what and where the results should be.
    Quang PT

  4. #4
    Registered User
    Join Date
    05-09-2017
    Location
    Malmo, Sweden
    MS-Off Ver
    2010
    Posts
    2

    Re: Combination of strings in 1 cell based on word found on multiple rows in table

    Yes, of course.
    Sorry.

    If you look at D77 in sheet 2,
    it should contain the string
    "Smörgås ansjovis, Smörgås räkor, Smörgås sill, Milanopinne, "
    since the word at A77 in sheet 2 (ägg)
    exists at rows 12, 19, 21 and 36 in sheet 1.

    Hence the words at B12, B19, B21 and B36 in sheet 1
    is seperated by comma-signs at D77 in sheet 2 as above.

    See new attached file.
    Thank you in advance.
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,228

    Re: Combination of strings in 1 cell based on word found on multiple rows in table

    tim201110 's reply gives you the result you want but not in a single cell.

    Concatenate them with formula or use a VBA function.

+ 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. Sumproduct of 2 columns, if one of 7 strings found in corresponding rows
    By lennartvl in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 09-28-2015, 10:09 AM
  2. [SOLVED] return cell value based on multiple strings
    By mariur89 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 01-12-2015, 11:32 AM
  3. Formula to Populate Multiple Cells Based on Text strings in Another Cell
    By RASoff in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-18-2014, 11:52 AM
  4. Replies: 3
    Last Post: 01-21-2014, 05:15 PM
  5. Replies: 7
    Last Post: 12-18-2013, 06:34 AM
  6. Replies: 1
    Last Post: 03-20-2012, 02:54 PM
  7. Replies: 3
    Last Post: 05-28-2011, 01:43 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