+ Reply to Thread
Results 1 to 6 of 6

Sum of columns until criteria is met, then adjacent cell continues until criteria is met a

  1. #1
    Registered User
    Join Date
    04-10-2019
    Location
    UK
    MS-Off Ver
    2010
    Posts
    10

    Sum of columns until criteria is met, then adjacent cell continues until criteria is met a

    Hi all,

    I’m looking to automate a totals column for my spreadsheet and need a little guidance. I’m trying to get a cell at the far right of the sheet to provide a total of the cells within that row until a set criteria is met, the cell in the next column then needs to calculate the total until the criteria is met again and so on.

    An image of what I’m trying to explain is below: (I have changed the information/style for confidential reasons)

    Picture1.png


    The highlighted columns are where I need the calculations to take place.
    The criteria is based on the comments for each build with calculations being made for builds if a possible 5 comments are present (in this example Cracked 1, cracked 2, cracked 3, cracked 4 and cracked 5).

    The first product (ABC for this example) has ‘Cracked 2’ on the 2nd build, so the 1st and 2nd build hours need to be added together in ‘Total 1’ column (for this example it totals 195 hours).
    The ‘total 2’ column then needs to calculate the next hours until the criteria is met again. For ABC this is on the 3rd build and so the total hours in ‘Total 2’ is 100 hours.


    Currently the calculation is manually changed when new data is entered, but as we increase our products it is harder to track any changes and would make the process easier.

    I’m not sure if this will be better with formulas in the sheet or with vba? If anybody could help, it is greatly appreciated.

    Please let me know if you need any further information.

    Thank you 
    Last edited by ra2019; 04-15-2019 at 05:16 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,310

    Re: Sum of columns until criteria is met, then adjacent cell continues until criteria is m

    Welcome to the forum!

    Will you please attach a sample Excel workbook? We are not able to work with or manipulate a picture of one and nobody wants to have to recreate your data from scratch.

    1. Make sure that your sample data are REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired results are also shown (mock up the results manually).

    3. Make sure that all confidential data is removed or replaced with dummy data first (e.g. names, addresses, E-mails, etc.).

    4. Try to avoid using merged cells as they cause lots of problems.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

    Please pay particular attention to point 2 (above): without an idea of your intended outcomes, it is often very difficult to offer appropriate advice.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    04-10-2019
    Location
    UK
    MS-Off Ver
    2010
    Posts
    10

    Re: Sum of columns until criteria is met, then adjacent cell continues until criteria is m

    Hi AliGW,

    Thank you for your reply.

    I have attached a very basic sample spreadsheet to show this. My original spreadsheet has more products listed, but the attached one should hopefully show the gist of it.

    I have manually entered a 'sum' calculation into the Total 1, Total 2 etc columns. I am hoping we could change this to a formula or coding to calculate the totals automatically.

    Thank you.
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2504
    Posts
    19,096

    Re: Sum of columns until criteria is met, then adjacent cell continues until criteria is m

    This proposal employs multiple helper columns (U:AF) which may be moved and/or hidden for aesthetic purposes.
    Columns U:Z are populated using:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Columns AA:AF are populated using: =IF(U3=T3,"",U3)
    The yellow shaded cells, columns P:S, are populated using:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  5. #5
    Registered User
    Join Date
    04-10-2019
    Location
    UK
    MS-Off Ver
    2010
    Posts
    10

    Re: Sum of columns until criteria is met, then adjacent cell continues until criteria is m

    Thank you so much JeteMc - you are a life saver !

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2504
    Posts
    19,096

    Re: Sum of columns until criteria is met, then adjacent cell continues until criteria is m

    You're Welcome. Thank You for the feedback and for marking the thread as 'Solved'. I hope that you have a blessed day.

+ 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. VBA to copy non-adjacent columns/cells based on cell criteria
    By exceljoker in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-29-2018, 04:34 PM
  2. [SOLVED] Countifs multiple criteria- criteria if cell is greater than another i adjacent column
    By Sircool1 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-26-2018, 11:23 AM
  3. [SOLVED] I need to fill 2 text columns based on criteria from 2 adjacent columns
    By JohnnyBoyxxx in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 11-04-2014, 02:55 PM
  4. [SOLVED] DSUM with non-adjacent criteria-columns
    By MichaelDam in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-14-2013, 12:29 PM
  5. [SOLVED] How to return 3 columns not adjacent to another worksheet with 2 criteria
    By marreco in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 10-25-2012, 02:29 AM
  6. [SOLVED] countif = < > AND value in adjacent columns match criteria
    By crafty_girl in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-27-2006, 03:45 PM
  7. [SOLVED] Sum Count of Single Criteria in Multiple Non-Adjacent columns
    By Sam via OfficeKB.com in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 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