+ Reply to Thread
Results 1 to 7 of 7

Concatenating values based on corresponding cell values

  1. #1
    Registered User
    Join Date
    11-23-2015
    Location
    Waltham, MA
    MS-Off Ver
    Excel 2013
    Posts
    3

    Concatenating values based on corresponding cell values

    Hello,

    I have a row (4) of factors (e.g. "Taller than 5'6", "older than 25", etc) and a row (7) of corresponding values (e.g. 40, 6, 0, 0, 8) which is populated if the particular person meets that criteria, so that a score can be produced. Once the score has been summed up, I want to have a string of text that takes only the values from row (4) where there is a value in row (7) that is greater than 0. That way, I can see which factors are contributing to the score (there are about 200 factors).

    I tried something like this:

    =concatenate(if(G4:P4>0,G7:P7))

    but it didn't work. I've done something similar with the sum function and it worked, but I'm trying to do the same thing with concatenate. Any help would be greatly appreciated.

  2. #2
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Concatenating values based on corresponding cell values

    CONCATENATE() doesn't work with ranges

    any example file (.xlsx) with what you have and what you want (result)?

    but you can do it half-manually:
    =CONCATENATE(TRANSPOSE(TRANSPOSE(IF(G4:P4>0,G7:P7,"")))
    Enter
    you will get error
    go to formula bar, highlight TRANSPOSE(TRANSPOSE(IF(G4:P4>0,G7:P7,"")), press F9, delete curly brackets { } (only two), and hit enter

    edit:
    if you want any delimiter, e.g. space ( " " ) or comma ( , ) you can do it like this:
    =CONCATENATE(TRANSPOSE(TRANSPOSE(IF(G4:P4>0,G7:P7,""))&",")
    and the rest is the same as above
    Last edited by sandy666; 11-23-2015 at 04:43 PM.

  3. #3
    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,946

    Re: Concatenating values based on corresponding cell values

    Hi, welcome to the forum

    Perhaps something like this?
    =IF(A4>0,A4,"")

    If that was not what you wanted, upload a small (clean) sample workbook (not a pic) of what you are working with, and what your expected outcome would look like.
    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

  4. #4
    Registered User
    Join Date
    11-23-2015
    Location
    Waltham, MA
    MS-Off Ver
    Excel 2013
    Posts
    3

    Re: Concatenating values based on corresponding cell values

    Dummy File.xlsx

    How about this?

  5. #5
    Registered User
    Join Date
    11-23-2015
    Location
    Waltham, MA
    MS-Off Ver
    Excel 2013
    Posts
    3

    Re: Concatenating values based on corresponding cell values

    Has anyone been able to open this document and tried to figure out a solution? Thanks

  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,946

    Re: Concatenating values based on corresponding cell values

    This is probably way too simplistic, but try,,,
    =SUBSTITUTE(TRIM(IF(H9>0,H8,"")&" "&IF(I9>0,I8,"")&" "&IF(J9>0,J8,"")&" "&IF(K9>0,K8,"")&" "&IF(L9>0,L8,""))," ",",")

    Also, you should avoid using merged cells like you have done there. If you want a "big" cell for the entry, make the row wider. Merged cells cause problems with formulas

  7. #7
    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,365

    Re: Concatenating values based on corresponding cell values

    VBA function ...


    Please Login or Register  to view this content.
    in E9

    =rtnVar(H9:L9,$H$8:$L$8)


    H9:L9 is the numeric data: H8:lL8 are the headings

    Change ranges as required

+ 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] Concatenating cell values to create sheet names
    By XLDabbler in forum Excel General
    Replies: 4
    Last Post: 08-27-2019, 11:49 AM
  2. [SOLVED] Concatenating variable cell values together
    By joevan1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-03-2015, 09:52 PM
  3. [SOLVED] Concatenating values two columns (column B, column C) based on criterion
    By marreco in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-16-2014, 11:31 AM
  4. Replies: 1
    Last Post: 10-01-2013, 02:41 AM
  5. Quote Crazy!! Concatenating filenames and cell values
    By fitzt70 in forum Excel General
    Replies: 2
    Last Post: 07-19-2013, 10:10 PM
  6. [SOLVED] Concatenating cell values
    By tray262 in forum Excel General
    Replies: 20
    Last Post: 11-11-2012, 09:22 AM
  7. Replies: 4
    Last Post: 01-24-2012, 03:20 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