+ Reply to Thread
Results 1 to 8 of 8

sumif: criteria - helper column is the first occurence

  1. #1
    Registered User
    Join Date
    03-22-2017
    Location
    United States
    MS-Off Ver
    2017
    Posts
    3

    sumif: criteria - helper column is the first occurence

    I have an accounting spreadsheet in Excel and we currently tie purchases to a unique identifier (p1, p2, p3, etc) so that we can also include details on each individual item in the purchase. The relevant parts of the table are as follows:

    Purchase ID | Project | item | total order price
    p1 | office | stapler | $100
    p2 | supplies | mop | $500
    p3 | office | stapler | $200
    p3 | office | tape | $200



    As you can see, p3 (or purchase 3) has $200 listed twice, because it is the same purchase, but shows the two different items on that purchase.

    I am having difficulty only pulling p3 once for this formula. I am also using an inserted table labeled "purchases" and like to reference columns by the column header name (ex: Purchases[Purchase ID]).


    Basically, what I am trying to obtain is a formula that will pull the total money spent on the "office" project, my thoughts are to incorporate a formula that only use the first occurrence of the purchase ID. The formula should pull $300 from the above table (p1+p3).

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: sumif: criteria - helper column is the first occurence

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Which in plain English is sum all values in column C for the rows where column A is P3 and column B is Office, then divide that by the number of rows which meet those conditions.

    That or a progressive count helper column and including that in the SUMIFS.

    BSB

  3. #3
    Registered User
    Join Date
    03-22-2017
    Location
    United States
    MS-Off Ver
    2017
    Posts
    3

    Re: sumif: criteria - helper column is the first occurence

    Thanks for the reply, unfortunately it doesn't quite fit my need.

    I need something which will pull all purchases where column B is office and Column A is all P#'s (but only the first occurrence of each P#). Your formula pulls $200, I need it to pull $300.

    To put context into this, each P# is a single purchase, which is why both [P3]'s have the same value. I want to be able to sum the [total order price] on the [Office], but since I have [200$] listed twice for [P3], if i do a regular sum it will add 200$ twice instead of once. I want a formula that can account for this, and will continue to work as I make more purchases.

    My current solution is a helper column with 1 to confirm its the first occurrence, and 0 to confirm its a duplicate, but that is just one more piece of information to have to enter that I would like to avoid.

    a simpler way to look at this is: How do I reference only first occurrences in a column.
    Last edited by kcees; 03-22-2017 at 02:48 PM.

  4. #4
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: sumif: criteria - helper column is the first occurence

    Maybe this?
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Adjust ranges to suit.

    BSB

  5. #5
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: sumif: criteria - helper column is the first occurence

    Do you mean something like this?

    Formula: copy to clipboard
    Please Login or Register  to view this content.



    A
    B
    C
    D
    E
    1
    Purchase ID
    Project
    item
    total order price
    Total Costs
    2
    p1
    office
    stapler
    $100
    $100
    3
    p2
    supplies
    mop
    $500
    $500
    4
    p3
    office
    stapler
    $200
    $300
    5
    p3
    office
    tape
    $200
    $0
    Dave

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: sumif: criteria - helper column is the first occurence

    Or more like this?

    Formula: copy to clipboard
    Please Login or Register  to view this content.



    A
    B
    C
    D
    E
    1
    Purchase ID
    Project
    item
    total order price
    Total Costs
    2
    p1
    office
    stapler
    $100
    $300
    3
    p2
    supplies
    mop
    $500
    $500
    4
    p3
    office
    stapler
    $200
    $300
    5
    p3
    office
    tape
    $200

  7. #7
    Registered User
    Join Date
    03-22-2017
    Location
    United States
    MS-Off Ver
    2017
    Posts
    3

    Re: sumif: criteria - helper column is the first occurence

    That is perfect BSB, and much simpler than I thought it would be thank you for your help!

  8. #8
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: sumif: criteria - helper column is the first occurence

    Happy to help

    BSB

+ 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. Sum multiple criteria with 0 to 3 cells helper only.
    By reggieneo in forum Excel General
    Replies: 4
    Last Post: 03-11-2017, 10:10 AM
  2. Sort by helper column even if values in helper are alike
    By NoSleepForMe in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-10-2016, 04:14 AM
  3. [SOLVED] computations within conditional criteria list extraction - eliminating helper columns
    By Nerpilis in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 05-15-2015, 02:21 PM
  4. [SOLVED] Multiple Criteria SUMIF Using Column as Negative Criteria
    By freybe06 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-24-2014, 04:46 PM
  5. [SOLVED] Find the second to the last occurence of a value in a column with multiple criteria
    By queenamidala in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-07-2013, 03:41 AM
  6. Replies: 4
    Last Post: 05-03-2013, 12:09 PM
  7. [SOLVED] SUMIFS and Date Criteria (Month Year etc...) but without helper column?
    By JungleJme in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 01-16-2013, 07:21 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