+ Reply to Thread
Results 1 to 8 of 8

How to combine similiar rows

  1. #1
    Registered User
    Join Date
    07-03-2010
    Location
    london, england
    MS-Off Ver
    Excel 2004
    Posts
    27

    How to combine similiar rows

    I have the following table
    Please Login or Register  to view this content.
    Sorry about the formatting "001 3434" is one division
    I am trying to combine the unique combinations of Area + Division
    So the resulting table would be:

    Please Login or Register  to view this content.
    Notice how before there were 2 lines with the same combination of Around and "001 5555". The new table has this line combined and the quarters of data summed.


    I was wondering if anyone could help me accomplish this (in terms of a macro, unless there is an easier way, subtotals doesnt work well because I would still have to manually input a lot of data) as it will greatly help me overcome some obstacles in a larger project
    Last edited by minimacros; 07-10-2010 at 07:46 PM.

  2. #2
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: How to combine similiar rows

    This might be so much easier if you were to post a sample workbook showing your table as is and the desired result.

  3. #3
    Registered User
    Join Date
    07-03-2010
    Location
    london, england
    MS-Off Ver
    Excel 2004
    Posts
    27

    Re: How to combine similiar rows

    Sorry for not posting one originally... here you go
    Attached Files Attached Files

  4. #4
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: How to combine similiar rows

    Try this macro in a standard module.
    Please Login or Register  to view this content.

    Hope this helps
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  5. #5
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: How to combine similiar rows

    You could simply do a pivot table. No code, just a few mouse clicks.

    See attached.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    07-03-2010
    Location
    london, england
    MS-Off Ver
    Excel 2004
    Posts
    27

    Re: How to combine similiar rows

    Hey so the macro works okay but unfortunately I forgot to put in the sample the possibility of having more than one type of the same spending. The attached workbook makes up for this problem.

    The current Macro would combine all lines based off the Type of Spending, not the combination of the two (Type of Spending and Dept). I was thinking maybe a SUMIFS instead of the SUMIF, but unfortunately I am on Office2004 and they don't have the SUMIFS.


    2 Questions: If I were to be able to use a Windows machine and the SUMIFS statement on excel 07/10 would the following command work (and then replace the rest of the Range formulas..

    2nd: What is a good workaround of SUMIFS for older versions of excel? (Question 1 is more important, I am trying to get the new windows version but it isn't that easy)

    Please Login or Register  to view this content.


    Here is the original code that I formatted for 10 columns of quarter data

    Please Login or Register  to view this content.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    07-03-2010
    Location
    london, england
    MS-Off Ver
    Excel 2004
    Posts
    27

    Re: How to combine similiar rows

    Hey, I was able to try the code on my roommates computer and it worked with the addition noted above. Thanks for the help... hopefully we will switch over soon!

  8. #8
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: How to combine similiar rows

    Might be an idea to try this
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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