+ Reply to Thread
Results 1 to 4 of 4

Sum data based on one criteria and two criteria.

  1. #1
    Forum Contributor
    Join Date
    12-14-2005
    Location
    US
    MS-Off Ver
    Excel 2019, Excel 365, Excel Mobile (Android)
    Posts
    181

    Sum data based on one criteria and two criteria.

    This project is progressing and almost complete. I have attached a workbook with VBA code, much of which contributed and many thanks to TMS. You rock.

    The last piece of this exercise is the aggregating the accrual amounts based on the reference criteria in Col A, and with one exception including a criteria in Col D in the DATA2 worksheet. The reference #'s in Col A provide for matching and summing the amounts into the table K2:L13.

    It all works fine except for the exception. The reference number in Col A: 0160A1 must be broken into two amounts based on certain criteria found in cells in Col D where their is a starting SP. Only the SP is relevant as the rest can be anything.

    So, the 0160A1 SP is the criteria for the sum. Note on DATA tab I have highlighted the rows that should form the 2nd grouping for totaling.

    I was thinking since we already have the formula to get the total for 0160A1 perhaps using the existing formula minus a similar formula adding in that second criteria will get what is needed. Just a thought.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    09-07-2014
    Location
    Israel
    MS-Off Ver
    office 365
    Posts
    3,184

    Re: Sum data based on one criteria and two criteria.

    Hi,
    perhaps you can use something like that (if I understand you correct):

    =SUM(IF(ISNUMBER((SEARCH("0160A1",A2:A400))*(SEARCH("sp",A2:A400))),1,0)*(D2:D400))

    This will sum up all the items containing '0160A1' / 'SP'

  3. #3
    Forum Contributor
    Join Date
    12-14-2005
    Location
    US
    MS-Off Ver
    Excel 2019, Excel 365, Excel Mobile (Android)
    Posts
    181

    Re: Sum data based on one criteria and two criteria.

    That formula works on DATA tab. However, I need to include something like that into the formula in cell K2 on DATA2 tab. This is where I am aggregating and summing the totals. The formula in K2 is:

    =LET(lr, COUNTA($A:$A)+3, f, $A$2:INDEX($A:$A, lr), l, $I$2:INDEX($I:$I, lr), u, UNIQUE(f), i, INDEX(m, MATCH(u, f, 0)),s, SUMIF(f, u, l), h, CHOOSE({1,3},u,i,s), h)

    This formula populates down including all the various criteria's in Col A

    I have been trying your formula and something similiar trying to get into the existing formula without success so far.

  4. #4
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    China Shanghai
    MS-Off Ver
    365 V2502 and WPS V2024(12.1.0.18543)
    Posts
    3,861

    Re: Sum data based on one criteria and two criteria.

    ANS. POST$1
    pls try this formula

    Formula: copy to clipboard
    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)

Similar Threads

  1. Replies: 1
    Last Post: 04-09-2021, 11:09 AM
  2. Replies: 2
    Last Post: 12-27-2020, 04:10 AM
  3. [SOLVED] Usine sumifs to change criteria range column based on dynamic criteria
    By Luiscarlos in forum Excel General
    Replies: 5
    Last Post: 11-19-2020, 09:33 AM
  4. [SOLVED] SUMUP Quantity Cumulatively Based on Criteria and Get Date Based On Criteria
    By Rajeshkumar R in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-27-2020, 11:30 PM
  5. VBA Macro Dividing Values Based upon Matching Criteria and Description Criteria
    By pvsvprasad in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 09-18-2016, 12:39 PM
  6. Replies: 0
    Last Post: 05-02-2016, 07:59 AM
  7. Replies: 4
    Last Post: 01-08-2013, 12:37 PM

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