+ Reply to Thread
Results 1 to 4 of 4

Subtotal of one column based on the value of two other columns

  1. #1
    Registered User
    Join Date
    08-18-2020
    Location
    London, England
    MS-Off Ver
    2016
    Posts
    7

    Subtotal of one column based on the value of two other columns

    Hello,

    I have a table of information which is exported out of a CRM programme. In the first column is the users name, the second column is a value which includes a subtotal for the user in the third column there is a letter (either C or L).

    I have managed to do a lookup to get the total for the user excluding the subtotal by using this formula. (WBT being the exported worksheet, column C is the value column, column B is their names. The DOC being the sheet the output is then displayed on).

    =INDEX(WBT!C:C,SUMPRODUCT(MAX(ROW(WBT!B:B)*(DOC!A9=WBT!B:B))))

    I now need to get the same result, only subtotalling the data in column B (in my example attached) based on the data in column C and excluding the subtotal that the CRM software has already calculated.

    So, for example, Where Column C has a C, I need the total of these . In this instance, John would be 8, Steve 17 and Mark would be 16.

    I have tried adding an IF argument to the above formula but does not like it. Any help gratefully received.

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    10-30-2019
    Location
    Bistrita, Romania
    MS-Off Ver
    2019; 365
    Posts
    231

    Re: Subtotal of one column based on the value of two other columns

    You could use a helper column to tell you which cell in B1:B26 contains a formula and which doesn't, eg in column D and drag down:
    =IF(ISFORMULA($B$1:$B$26)=FALSE;1;0)

    Then in E1:
    =SUMIFS(B1:B26;A1:A26;"John";C1:C26;"C";D1:D26;1)
    To show your appreciation
    Click ★ Add reputation!

  3. #3
    Registered User
    Join Date
    08-18-2020
    Location
    London, England
    MS-Off Ver
    2016
    Posts
    7

    Re: Subtotal of one column based on the value of two other columns

    Unfortunately when the data is exported and copied into the worksheet, there is no formula, it is just a value.

  4. #4
    Forum Contributor
    Join Date
    10-30-2019
    Location
    Bistrita, Romania
    MS-Off Ver
    2019; 365
    Posts
    231

    Re: Subtotal of one column based on the value of two other columns

    Oh, ok.

    If the data comes as in the example file except for the subtotals' formulas, you could add the following formula to D column and drag down to get 1 and 0, similarly as in my previous post:
    =IF(AND(B1<>"";B2<>"");1;0)

    With the formula above it shows 1 next to all cells except the subtotal cell and the empty cell following it.

    Then in E1 you can add the formula I posted before and there's the result.

    Maybe this can be done in another more professional way I can't think of.

+ 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. [SOLVED] Subtotal Across Columns at last record from Column I to GR
    By jantonio in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-28-2019, 07:17 PM
  2. Subtotal based on conditions met in another column
    By Lunaki in forum Excel General
    Replies: 11
    Last Post: 06-09-2017, 01:51 AM
  3. [SOLVED] How to subtotal an excel column based on specific data of another column ?
    By talib.essami in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-20-2016, 09:35 PM
  4. [SOLVED] Marco for pivot table like fuctions. Subtotal column C, based on column B criteria.
    By RobertOHare in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-09-2013, 02:57 PM
  5. subtotal one column based on the range of two other columns
    By jshot99 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-31-2011, 03:55 PM
  6. Replies: 2
    Last Post: 02-14-2011, 03:52 PM
  7. Subtotal database based on column with faked date
    By JonasP in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-05-2006, 11:10 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