+ Reply to Thread
Results 1 to 5 of 5

[SOLVED]Extract distinct cells and sum values next to

  1. #1
    Registered User
    Join Date
    03-14-2012
    Location
    Athens
    MS-Off Ver
    Excel 2007
    Posts
    12

    [SOLVED]Extract distinct cells and sum values next to

    Hello to all. I'm having a problem that i can't solve.(i can do it by sorting values, or with pivot table).
    I have a table with two columns. In the first column there are cells that appear many times.Next to each cell there is a value.
    I want to extract distinct values from the first column and sum next to each distinct extracted cell all the values.


    I'm attaching an example

    Thanks a lot
    Attached Files Attached Files
    Last edited by nsourm; 03-14-2012 at 11:44 AM.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,423

    Re: Extract distinct cells and sum values next to

    The attached file shows how this can be done. I've inserted a header row and put this array* formula in D2:

    =IFERROR(INDEX(A$2:A$21,MATCH(0,COUNTIF($D$1:D1,A$2:A$21),0)),"")

    *An array formula needs to be committed using the key combination of Ctrl-Shift-Enter rather than the usual <Enter>.

    Then I have this formula in E2:

    =IF(D2="","",SUMIF(A:A,D2,B:B))

    and then both these formulae can be copied down as far as you think you will need (I've copied to row 7).

    Hope this helps.

    Pete
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    03-14-2012
    Location
    Athens
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Extract distinct cells and sum values next to

    Thanks a lot Pete.
    You save my life.

    Kind regards
    Nick

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,423

    Re: Extract distinct cells and sum values next to

    You're welcome, Nick.

    Perhaps you can mark the thread as Solved, and you can also express your thanks further by clicking on the "Star" icon in the bottom left corner of any thread that has helped you.

    Pete

  5. #5
    Registered User
    Join Date
    03-14-2012
    Location
    Athens
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Extract distinct cells and sum values next to

    ok Pete will do

+ 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