+ Reply to Thread
Results 1 to 7 of 7

combine cells based on criteria of separate cells

  1. #1
    Registered User
    Join Date
    12-12-2012
    Location
    Orlando, FL
    MS-Off Ver
    Excel 2010
    Posts
    40

    combine cells based on criteria of separate cells

    I have data in cells A4, B4, D4 and E4 and a set of "selector" cells in P8-S8 on the same worksheet. What I would like to happen is if the user selects P8 (by entering an 'x') then cell G8 would equal the value of A4. If the user also selects cell Q8 then the value of cells A4 & B4 are combined within cell G8. This would apply for any combination of the user selecting cells P8:S8
    There will also be a hyphen that needs to be included between the values of data from cells A4, B4, D4 and E4.

    I think an example will make it much easier to understand so a sample file is attached.
    Attached Files Attached Files

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: combine cells based on criteria of separate cells

    Would it be fair to assume that the answer you seek would not be just for row 4?

  3. #3
    Registered User
    Join Date
    12-12-2012
    Location
    Orlando, FL
    MS-Off Ver
    Excel 2010
    Posts
    40

    Re: combine cells based on criteria of separate cells

    That would be correct dave. It will be copied down to all rows

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: combine cells based on criteria of separate cells

    What will be copied down?
    If you change P8:S8 and that reflects G8 to =A4 & B4

  5. #5
    Registered User
    Join Date
    12-12-2012
    Location
    Orlando, FL
    MS-Off Ver
    Excel 2010
    Posts
    40

    Re: combine cells based on criteria of separate cells

    Cells P8:S8 will remain static and are the determining factor for the full sheet. The formula itself will be copied down the full column of G. Row G is constant as it relates to cells A,B,D & E so the result of G7 will be the data from A7, B7, D7 & E7 and so forth.

    Hopefully that makes sense to someone besides me.

  6. #6
    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,192

    Re: combine cells based on criteria of separate cells

    Try this:

    Change entries in P8:S8 to 1, 2, 3, 4

    in G4

    =SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE($P$8&$Q$8&$R$8&$S$8,1,TEXT(A4,"00")),2,TEXT(B4,"000") &"-"),3,TEXT(D4,"00")&"-"),4,E4)

    See attached with results in T8 down
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    12-12-2012
    Location
    Orlando, FL
    MS-Off Ver
    Excel 2010
    Posts
    40

    Re: combine cells based on criteria of separate cells

    John that appears to do the trick. I'll play with it a bit to verify but on initial try it seems to be exactly what I was looking for.

    Thank you for the help

+ 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. Combine text from multiple cells based on criteria from other cells
    By t2cool in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-07-2017, 12:03 PM
  2. combine cells based on criteria
    By jjbigfish77 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-10-2016, 06:09 PM
  3. Combine cells based on criteria
    By thisismyname2 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-11-2016, 04:16 PM
  4. Combine multiple cells into one and separate it by a comma
    By rose9812in in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 09-18-2015, 02:58 AM
  5. [SOLVED] Combine Several Cells into a New Cell Based on Criteria
    By Exia in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-14-2012, 06:15 PM
  6. Replies: 2
    Last Post: 12-03-2011, 03:51 AM
  7. Replies: 1
    Last Post: 12-08-2010, 09:59 AM

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