+ Reply to Thread
Results 1 to 5 of 5

Combining rows if 2 values are met

  1. #1
    Registered User
    Join Date
    10-05-2021
    Location
    Netherlands
    MS-Off Ver
    2016
    Posts
    10

    Question Combining rows if 2 values are met

    Hi there, I'm trying to combine multiple rows of answers by the same subject based on an Subject number and a certain text. For example rows 2 through 4 should be combined into a single row as their subject number and text matches, this should result in Subject 123 with the text Hello this is a test, in 2010 with times picked A = 6, B = 2, C= 3 and D = 1 in this row.

    I tried doing this by creating IF formulas, but I could not figure out how to have it automatically loop to keep comparing to the row below. I also tried to write a VBA code, which works for a single row and a single column, but I cannot figure out how to make it check multiple rows and loop automatically.

    Any help is greatly appreciated!
    Attached Files Attached Files

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Combining rows if 2 values are met

    Hi,

    I can't help thinking a Pivot Table isn't the most obvious

    See attached
    Attached Files Attached Files
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Valued Forum Contributor
    Join Date
    09-19-2008
    Location
    It varies ...
    MS-Off Ver
    Office365 - 64bit
    Posts
    862

    Re: Combining rows if 2 values are met

    Try this:
    Please Login or Register  to view this content.
    MatrixMan.
    --------------------------------------
    If this - or any - reply helps you, remember to say thanks by clicking on *Add Reputation.
    If your issue is now resolved, remember to mark as solved - click Thread Tools at top right of thread.

  4. #4
    Registered User
    Join Date
    10-05-2021
    Location
    Netherlands
    MS-Off Ver
    2016
    Posts
    10

    Re: Combining rows if 2 values are met

    Quote Originally Posted by MatrixMan View Post
    Try this:
    Please Login or Register  to view this content.
    Thank you this seems to be working perfectly! In my actual database I use columns A-AB. After expanding from CelD onwards instead of using CelY for year and CelT for the text and CelS can I just use AC, AD, AE?

  5. #5
    Valued Forum Contributor
    Join Date
    09-19-2008
    Location
    It varies ...
    MS-Off Ver
    Office365 - 64bit
    Posts
    862

    Re: Combining rows if 2 values are met

    Quote Originally Posted by losc View Post
    Thank you this seems to be working perfectly! In my actual database I use columns A-AB. After expanding from CelD onwards instead of using CelY for year and CelT for the text and CelS can I just use AC, AD, AE?
    Sorry - I'm not picturing this .. it's fairly easy to expand and if you've managed to get it sorted then great; if not, attach the real file and I'll adjust it for you.

+ 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. Formula for Combining Values from Rows
    By iabhishek in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-05-2020, 11:09 AM
  2. Replies: 5
    Last Post: 07-31-2018, 01:43 PM
  3. Need Help Combining rows and totaling cell values within them
    By Happy Hooker in forum Excel General
    Replies: 1
    Last Post: 01-04-2017, 04:25 PM
  4. Combining some of the rows Values based on multiple criteria (2)
    By Svenbe in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-18-2014, 08:59 AM
  5. Combining Rows Based On Matching Values in one column
    By jeffocasm in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-15-2013, 07:16 PM
  6. Combining rows where some cells have null values
    By speechcommgal in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-23-2013, 02:27 PM
  7. Combining Values in rows and keeping unique values (adv. filtering?)
    By nguyeda in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-26-2011, 01:48 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