+ Reply to Thread
Results 1 to 10 of 10

Concatenate based on filtered results in first column

Hybrid View

  1. #1
    Registered User
    Join Date
    08-08-2016
    Location
    NEW YORK
    MS-Off Ver
    Mac 15.15
    Posts
    4

    Concatenate based on filtered results in first column

    I have a project I'm working on that requires me to make a selection in column A (Choosing a template that contains the words Right, Left or Front). The selection from column A is used to generate a filename in column C but I don't want to use the word template in the filename. i only want the filename to pull the position (Left, Right or Front) from column A so the filename works out to be: Effect_Front_NY (Effect_ would be text added during the concatenate, Front would be pulled from Template_Front in column A and NY would be pulled from column B.)

    Screen Shot 2016-08-08 at 11.11.49 AM.png


    I'm sure there is a way to do this but I'm just overlooking it. Appreciate any help that you can offer!

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,450

    Re: Concatenate based on filtered results in first column

    In C1, copied down (not tested):

    ="Effect_"&SUBSTITUTE(A1,"Template_","")&"_"&B1
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: Concatenate based on filtered results in first column

    In cell C1:
    =SUBSTITUTE(A1&"_"&B1,"Template","Effect")
    http://chandoo.org/excel-formulas/substitute.shtml
    Please ensure you mark your thread as Solved once it is. Click here to see how.
    If a post helps, please don't forget to add to our reputation by clicking the star icon in the bottom left-hand corner of a post.

  4. #4
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Concatenate based on filtered results in first column

    Try this formula
    Formula: copy to clipboard
    =IF(COUNTIF(A1,"*Front*")+COUNTIF(A1,"*Left*")+COUNTIF(A1,"*Right*")>0,SUBSTITUTE(A1&B1,"Template","Effect"),"")

  5. #5
    Registered User
    Join Date
    08-08-2016
    Location
    NEW YORK
    MS-Off Ver
    Mac 15.15
    Posts
    4

    Re: Concatenate based on filtered results in first column

    Thanks for the help. I realized that I have one more variable I need to consider. What if the values in column A are more varied? The text in my first example was the same except for the position. Now I have text that has different character lengths so the substitute function doesn't seem to work. I also need to include additional text at the end of the filename.

    In the sample below the filename NBA_GAME_MU_ATL_LEFT_F is generated this way:
    NBA_GAME_MU_ - Text that will be at the start of every filename
    ATL - Tricode (Column A)
    _- Underscore that should alway separate the tricode from the position that follows
    LEFT - Pulled from the Comp in Column B. I need to be able to pull FrontBack, Right and Left out of the values in Column
    _F - Text that should come at the end of every filename

    Screen Shot 2016-08-08 at 12.37.13 PM.png

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,450

    Re: Concatenate based on filtered results in first column

    As this is now getting more complicated, please attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  7. #7
    Registered User
    Join Date
    08-08-2016
    Location
    NEW YORK
    MS-Off Ver
    Mac 15.15
    Posts
    4

    Re: Concatenate based on filtered results in first column

    Sample file uploaded with before and after tabs.
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: Concatenate based on filtered results in first column

    Your sample doesn't make any sense.
    Row 2 shows ANIM_MATCH_FrontBack_01_NBA_TEMPLATE changing to NBA_GAME_MU_ATL_LEFT_F... shouldnt that be FRONT_F and not LEFT_F

    Having a precise and accurate sample will allow us to help you

  9. #9
    Registered User
    Join Date
    08-08-2016
    Location
    NEW YORK
    MS-Off Ver
    Mac 15.15
    Posts
    4

    Re: Concatenate based on filtered results in first column

    You're right - I missed that. My apologies. I updated the file.
    Attached Files Attached Files

  10. #10
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Concatenate based on filtered results in first column

    Hi
    I use a helper column M to simplify the formula
    So in M2 use
    Formula: copy to clipboard
    =1*(COUNTIF(B2,"*Front*")>0)+2*(COUNTIF(B2,"*Left*")>0)+3*(COUNTIF(B2,"*Right*")>0)

    In K2 use
    Formula: copy to clipboard
    =IF(M2>0,"NBA_GAME_MU_"&A2&"_"&INDEX({"FRONT_L";"LEFT_L";"RIGHT_L"},M2),"")

    see the file
    Attached Files Attached Files

+ 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. 2 Conditions, concatenate results from column
    By TotallyLost in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-20-2016, 11:00 AM
  2. [SOLVED] How to pull data based on Filtered results - To create Statement of Account
    By ec4excel in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 06-28-2013, 11:36 AM
  3. calculate weighted standard deviation based on filtered results
    By mcdermott2 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-18-2013, 02:14 PM
  4. Replies: 1
    Last Post: 11-01-2012, 12:28 AM
  5. Print sheets based on filtered results from multiple workbooks
    By Lungfish in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-10-2011, 04:00 AM
  6. Creating chart based on a filtered results
    By delyan.peyankov in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 04-21-2011, 04:33 AM
  7. Graph based on Filtered results
    By Steve in forum Excel General
    Replies: 0
    Last Post: 03-30-2005, 12:06 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