+ Reply to Thread
Results 1 to 4 of 4

unique across three conditions, then sumif

  1. #1
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    unique across three conditions, then sumif

    hi folks,

    please help me with this.


    A
    B
    C
    D
    E
    F
    1
    ID
    Item
    Quantity
    Unit of Measure
    Vials
    Lab
    2
    1
    B421009
    1.5
    g
    1
    lab1
    3
    2
    B421009
    1
    g
    1
    lab1
    4
    3
    B421009
    1.2
    g
    2
    lab2
    5
    4
    B421009
    1.2
    g
    2
    lab3
    6
    5
    B421009
    100
    mg
    1
    lab1
    7
    6
    1421009
    n/a
    ea
    1
    lab1
    8
    7
    1421009
    n/a
    ea
    1
    lab2
    9
    8
    1421009
    n/a
    ea
    1
    lab3



    this table above needs to be condensed to this format below:



    H
    I
    J
    K
    L
    1
    ID
    Item
    Quantity
    Unit of Measure
    Vials
    2
    1
    B421009
    100
    mg
    1
    3
    2
    B421009
    1
    g
    1
    4
    3
    B421009
    1.2
    g
    4
    5
    4
    B421009
    1.5
    g
    1
    6
    5
    1421009
    n/a
    ea
    3


    if it presents some difficulty, then i am not particular about "g" coming before "mg" or otherwise, the "1" part number coming before "B" part number etc., as long as they are all nice grouped together (by part number). the quantities should be in an ascending order, as much as possible for easy deduction. rest of the logic is explained in the tables.

    please let me know if you have any question.

    formula and macro welcome.

    do not want helper column, advanced filtering, pivot tables solutions.
    Last edited by icestationzbra; 05-28-2014 at 12:15 AM. Reason: emphasise...
    - i.s.z -
    CSE, aka Array aka { }, formulae are confirmed with CONTROL+SHIFT+ENTER.
    Replace commas ( , ) with semicolons ( ; ) in formulae, if your locale setting demands.
    All good ideas are courtesy resources from this forum as well as others around the web.
    - e.o.m -

  2. #2
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: unique across three conditions, then sumif

    Why not use a pivot table?
    Please ensure you mark your thread as Solved once it is. Click here to see how.
    If a post helps, please don't forget to add to our reputation by clicking the star icon in the bottom left-hand corner of a post.

  3. #3
    Registered User
    Join Date
    05-23-2013
    Location
    California, USA
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: unique across three conditions, then sumif

    It can be done without VBA, but of course with VBA also.

    The easiest method is to begin by Advanced Filtering the following columns: Item, Quantity, Units of Measure.

    Just in case you need a refresher, Advanced Filter is located in Data ribbon, then click "Advanced".

    In the box that appears make sure to select "Copy to another location", then for the List Range manually drag your cursor over the range of beginning with Items through Unit of Measure (include headers).

    The next part will be to create the Vials calc, this is done using a sumifs formula.
    The sumifs formula I used looks like this: =SUMIFS($E$2:$E$9,$B$2:$B$9,I2,$C$2:$C$9,J2,$D$2:$D$9,K2)

    You may need to update this to the cells that are relevant to you, either that or look at my attached workbooks as an example.

    Finally, go back and add a simple formula that creates unique consecutive numbers for your "ID".

    Hope this helps..
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: unique across three conditions, then sumif

    Yeah that method works, but it is not something I would want to REdo. I still think a pivot table could work, wouldn't it?

+ 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 unique with conditions
    By Brian D via OfficeKB.com in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-29-2005, 05:05 PM
  2. [SOLVED] count unique with conditions
    By Domenic in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 09-06-2005, 04:05 AM
  3. count unique with conditions
    By \ditzman via OfficeKB.com\ in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  4. count unique with conditions
    By \ditzman via OfficeKB.com\ in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  5. [SOLVED] count unique with conditions
    By \ditzman via OfficeKB.com\ in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 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