+ Reply to Thread
Results 1 to 6 of 6

Totalling identical cells

  1. #1
    Registered User
    Join Date
    02-05-2009
    Location
    New York
    MS-Off Ver
    Excel 2003
    Posts
    11

    Totalling identical cells

    Hi,

    I am using Excel 2003 (on Windows XP). I need to put together an Excel formula or macro, etc., which will take a table of data (which will always have the same number of columns but the number of rows will vary), and perform the following changes to it:

    1)Insert a new column B in between the previous column A and B (B now becomes C)

    2) Add a new quantity total to the new column B if the following “if” conditions are met. 2a- Description needs to be identical (as in C12 & C13), 2b- Serial No needs to be identical or blank (as in E12 & E13), 2c- Case # needs to be identical (as in old B12 & B13, now new A12 & A13)

    If these three conditions are met a new quantity total in created at the first instance new column B (TTL_QTY), and the duplicate instances (row 13) are deleted or cleared.

    Can anyone help me with this or point me in the right direction?

    A before and after example is attached.

    Thanks.

    - Tom
    Attached Files Attached Files

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Totalling identical cells

    You would need macros to manipulate the rows themselves, but a formula to help you ID duplicate entries would be something like this:

    =SUMPRODUCT(--(C4&E4=$C$4:$C$26&$E$4:$E$26))

    Copy that down from Row4 through 26 and you'll get a duplication count for each row.

    EDIT: Just noticed you wanted 3 cells checked, that's this version:

    =SUMPRODUCT(--(A4&C4&E4=$A$4:$A$26&$C$4:$C$26&$E$4:$E$26))
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    02-05-2009
    Location
    New York
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Totalling identical cells

    =SUMPRODUCT(--(A32&C32&D32=$A$32:$A$54&$C$32:$C$54&$D$32:$D$54)) as a formula in B32:B54 does a great job of count the similar or dissimilar entries.

    Now in terms of getting rid of the duplicates, can anyone think of a more elegant solution than:

    DATA, FILTER, ADVANCED FILTER, UNIQUE RECORDS ONLY ?

    Thanks.

    - Tom

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Totalling identical cells

    That looks pretty simple. Define "elegant".

  5. #5
    Registered User
    Join Date
    02-05-2009
    Location
    New York
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Totalling identical cells

    Quote Originally Posted by JBeaucaire View Post
    That looks pretty simple. Define "elegant".
    Well, I guess I should have tried it before I wrote that because it is not working. I think that because the =SUMPRODUCT(--(A2&C2&D2=$A$2:$A$3000&$C$2:$C$3000&$D$2:$D$3000)) forumla is changing row by row, it is making the row "unique." at least that is my theory. Regardless, when I run those commands Excel is not filtering out the duplicate entries. Any thoughts?

    - Tom

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Totalling identical cells

    pivot table perhaps?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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