+ Reply to Thread
Results 1 to 13 of 13

Sum values based on other columns

  1. #1
    Registered User
    Join Date
    10-28-2021
    Location
    Derbyshire, UK
    MS-Off Ver
    16.21.1 Mac
    Posts
    6

    Sum values based on other columns

    Hi, bit of a punter here so forgive me.

    I need to sum values in one column based on two others.

    Column A contains product codes, Column D contains order dates and Column F contains the quantities that I would like totalled and placed in a new column.

    My first issue is how to sum these (there are thousands of rows) based on each unique code in A. For example, there might be twenty rows under the code 22P1, 25 under 22P2 and onwards to 22P500.

    My second is how to sum these based on order dates - specifically pre 15/01/2022, between 15/01/2022 and 30/5/2022, and on 1/6/2022 exactly.

    So for each product code there would be a new summed value (of Column F) in three more columns (one for each date criteria).

    Apologies if I haven't explained myself very well. I have played with SUMIFS but to be honest I'm not very clued up here. I cannot seem to attach a screenshot of the table in question.

    Thanks in advance for any advice. I'm looking to understand the process as well and get a result!

    Cheers.

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

    Re: Sum values based on other columns

    Welcome to the forum.

    There are instructions at the top of the page explaining how to attach your sample workbook.

    A good sample workbook has just 10-20 rows of representative data. It also has expected results mocked up, relevant cells highlighted and a few explanatory notes.
    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.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    10-28-2021
    Location
    Derbyshire, UK
    MS-Off Ver
    16.21.1 Mac
    Posts
    6

    Re: Sum values based on other columns

    Thank you for the help here, apologies I missed the above. Sample attached.
    Attached Files Attached Files

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,591

    Re: Sum values based on other columns

    Thanks for the workbook.

    This tutorial will show you what to do (look at the 'Sum if between two dates and another criteria' section): https://www.ablebits.com/office-addi...een-two-dates/

    Give it a go, then shout if you need any clarification for your data.

  5. #5
    Registered User
    Join Date
    10-28-2021
    Location
    Derbyshire, UK
    MS-Off Ver
    16.21.1 Mac
    Posts
    6

    Re: Sum values based on other columns

    Thank you again for the quick reply, that is really useful. There are a couple of things I'm struggling with:

    1) How would the sumifs formula recognise all duplicate product codes in Columns A?
    2) Where would I enter the formula in the new columns? Would excel automatically use the cell at the bottom of each product code grouping, if I was to enter it in the first necessary cell (i.e. first product code group) and then extended it down the whole column? Or would that just populate every cell?

    Sorry for questions and thanks again.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,591

    Re: Sum values based on other columns

    The problem with your sample workbook is that it does not show what you want.

    Here's a reminder of what I said earlier:

    A good sample workbook has just 10-20 rows of representative data. It also has expected results mocked up, relevant cells highlighted and a few explanatory notes.
    I can't really answer your questions unless you show us what you want.

  7. #7
    Registered User
    Join Date
    10-28-2021
    Location
    Derbyshire, UK
    MS-Off Ver
    16.21.1 Mac
    Posts
    6

    Re: Sum values based on other columns

    OK sorry for not making myself clear! I have updated the sample sheet, hopefully this will be better. Thank you again for your help and time.
    Attached Files Attached Files

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,591

    Re: Sum values based on other columns

    Right - so you want subtotals?

  9. #9
    Registered User
    Join Date
    10-28-2021
    Location
    Derbyshire, UK
    MS-Off Ver
    16.21.1 Mac
    Posts
    6

    Re: Sum values based on other columns

    Yes, based on the Product Groups in Column A and the date criteria specified. Thank you!

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,591

    Re: Sum values based on other columns

    Thanks. Someone else will run with this. I have to go now (I'm doing a photography course and need to do some practice).

  11. #11
    Registered User
    Join Date
    06-10-2011
    Location
    Manchester
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Sum values based on other columns

    the Key is to Quote "" your Less than / Greater than criteria, and concatenate (&) with the quoted dates, too. Solution attached.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    10-28-2021
    Location
    Derbyshire, UK
    MS-Off Ver
    16.21.1 Mac
    Posts
    6

    Re: Sum values based on other columns

    Thank you Dan!

  13. #13
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,591

    Re: Sum values based on other columns

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Thanks for the rep.

    PS I am a Derbyshire lass by birth.

+ 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. Finding the max of a list of columns, based on the values of other columns
    By galapogos in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-20-2017, 05:45 AM
  2. [SOLVED] Find count of Unique or Duplicate Values based on Concatenated values in 2 columns
    By bdicarlo1 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 12-03-2014, 12:42 AM
  3. [SOLVED] Copy/Paste multiple columns as values based on another columns criteria
    By Dgp2012 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-28-2013, 06:50 AM
  4. [SOLVED] Distribute values in columns based on match between two other columns
    By hydrgal in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-15-2013, 04:07 AM
  5. Locking columns based on calculated cell values in columns across a sheet.
    By andyr826208 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-04-2012, 05:17 AM
  6. Replies: 0
    Last Post: 09-15-2012, 02:56 AM
  7. Replies: 4
    Last Post: 06-28-2012, 07:08 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