Results 1 to 5 of 5

Thread: VBA to create a summary of three columns of data with two column criteria

  1. #1
    Seeker KristenB's Avatar
    Join Date
    Jan 2020
    Posts
    14
    Articles
    0
    Excel Version
    365

    VBA to create a summary of three columns of data with two column criteria



    Register for a FREE account, and/
    or Log in to avoid these ads!

    I need to create a summary for data entry based on three columns. The three columns are project code, expense code and amount. My summary needs to summarize data in the manner of - each row with the same expense code and project code need to be summed in the summary. So, there might be 15 rows with 5 different project codes and the project codes may have the same expense code, and if they do, I need those to sum into a summary. Then, if the project code used in the first summary line has another entry, but with a different expense code, I need it to see if that expense code and project code set have others that need to be added to them and summed in the new amount column. This is hard to explain but if you look at the attached image you can see the data in the left of the spreadsheet... and I need it to summarize as I have manually summarized the data on the right side of the spreadsheet image:

    Can anyone tell me how to make this happen using VBA?

  2. #2
    Administrator AliGW's Avatar
    Join Date
    Nov 2015
    Location
    Ipswich, Suffolk, England
    Posts
    1,339
    Articles
    0
    Excel Version
    Office 365 Subscription
    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not provided the required cross-post link(s) here.

    Read this to understand why we (and other sites like us) consider this to be important.

    https://www.excelforum.com/excel-pro...-is-empty.html
    Ali
    Enthusiastic self-taught user of MS Excel!

  3. #3
    Seeker KristenB's Avatar
    Join Date
    Jan 2020
    Posts
    14
    Articles
    0
    Excel Version
    365
    What I posted on the other site was different. This forum I am asking how to create the summary, the other forum I simply asked how to copy fields only if all three fields were not blank. I did not ask how to create the summary because I was awaiting a response from this forum when I realized that the blank fields would be an issue. You can see by my link below that the question was completely different. This post is asking how to create the summary, my other post is only asking how to remove cells of data if one of the cells is blank. If the post is being denied based on the image posted, that was an error in that post as it wasn't even valid. However, I didn't know how to remove that image.

    https://www.excelforum.com/excel-pro...-is-empty.html

  4. #4
    Administrator AliGW's Avatar
    Join Date
    Nov 2015
    Location
    Ipswich, Suffolk, England
    Posts
    1,339
    Articles
    0
    Excel Version
    Office 365 Subscription
    The image was indeed misleading, so I have removed it for you.
    Ali
    Enthusiastic self-taught user of MS Excel!

  5. #5
    Seeker KristenB's Avatar
    Join Date
    Jan 2020
    Posts
    14
    Articles
    0
    Excel Version
    365
    Thank you. I have ended up using a work-around for the summary request. I merged two of the fields using concatenate to a separate range which allowed me to then use a pivot table without such a 'scary' result to parse through. I am still waiting for a response on my other post though in order to improve the pivot table but it will work as I have it for now. I'm sorry that the image caused it to appear that I had crossposted. It was not my intention and I would certainly have noted that I had crossposted if I had.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •