+ Reply to Thread
Results 1 to 23 of 23

combine identical cells and get count

  1. #1
    Registered User
    Join Date
    06-10-2008
    Location
    Overland Park KS
    Posts
    15

    combine identical cells and get count

    I'm a newbie here so please forgive me if I explain this wrong!

    I don't know if I am explaining this correctly. I have a list of transactions on accounts that have the account name multiple times. I want a count of just those account names but without the copies for the different transactions. I have like 5 entries (transactions) on say Bob Smith's Towing I need it to combine all five entries into one or delete all but one so I have a true count of how many accounts I have. Does this make sense?

    Thanks!!

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    So you only want to count unique account names?

    Try:

    =SUMPRODUCT((A1:A1000<>"")/COUNTIF(A1:A1000,A1:A1000&""))


    adjust the ranges to adapt to your list.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    06-10-2008
    Location
    Overland Park KS
    Posts
    15
    no basically i have an account name multiple times and need a count of just the first time its listed...not the total of all of it?

    clear as mud??


  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    That should be what the formula does...

    If you have 5 "Joe's Towing" and 10 "Jack's Towing" in the list.. then formula will return a count of 2.

    Is that not what you need?

    If not... please attach a sample of your data and what you need returned as a result.

  5. #5
    Registered User
    Join Date
    06-10-2008
    Location
    Overland Park KS
    Posts
    15
    awesome thanks!!

    is there a way to combine those multiple lines so then I can use that for a pivot table?

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    That's what a pivot table does... it consolidates the list and gives summaries (either counts of records, sums of records, averages, etc).

    Here are some Pivot Table tutorials....

    http://www.microsoft.com/dynamics/us...s_collins.mspx

    http://www.cpearson.com/excel/pivots.htm

    http://peltiertech.com/Excel/Pivots/pivotstart.htm

  7. #7
    Registered User
    Join Date
    06-10-2008
    Location
    Overland Park KS
    Posts
    15
    i know but i need to use that count i just found (first line only) and then use that in my pivot table.

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    I'm confused....

    you may have to post a sample sheet detailing your haves and want-to-haves.

  9. #9
    Registered User
    Join Date
    06-10-2008
    Location
    Overland Park KS
    Posts
    15
    i can't attach it for some reason..says its too large !!

  10. #10
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Did you try to zip it first...

    if still too large... slim the file down first with some relevant data and then send it.

  11. #11
    Registered User
    Join Date
    06-10-2008
    Location
    Overland Park KS
    Posts
    15
    here it is. i have added the pivot table i am needing to do but the pol_idx is what i need just the first line count for - right now it is counting everytime it sees that pol_idx.

    tia!!
    Attached Files Attached Files

  12. #12
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    I am sorry, but I still don't fully get your requirement...

    I have reattached your workbook with a calculation using the above formula. It counted 661 unique records.

    I also added a simple Pivot Table that counts how many times each unique item occurs...

    If none of these are what your are looking for, then please show your expected results using the data you have in this workbook.
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    06-10-2008
    Location
    Overland Park KS
    Posts
    15
    I only want the count of the pol_idx to be the first line - not the number of times it is in the report which it is doing now with your pivot table. i'm having to give a report of how many accounts we have in each state by the type and if i just input the count of the pol_idx it gives me a false number because it is including the mulitples (i.e. the pol_idx number is repeated). i need to somehow have it only count that first line (first time its (pol_idx) is listed) in the pivot table. is this possible?

    hopefully this makes more sense. i'm sorry!

    i really appreciate your help!!

    thanks so much!

  14. #14
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    What about using Data|Filter|Advanced Filter to extract a list of unique records...

    see column N in the attached...
    Attached Files Attached Files

  15. #15
    Registered User
    Join Date
    06-10-2008
    Location
    Overland Park KS
    Posts
    15
    but can i use that in a pivot table? like i mentioned before i need to show by state and type with the unique items...

    it may not be possible.

  16. #16
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    I doubt you can do that with Pivot Tables (if I am understanding you correctly).. Pivot tables summarize they don't extract certain records.

    You can possible extract the unique list from column A as I did with Advanced Filter and then use Vlookup to extract the detail from the first occurance of each item...

    See again the sample sheet Columns N:S
    Attached Files Attached Files

  17. #17
    Registered User
    Join Date
    06-10-2008
    Location
    Overland Park KS
    Posts
    15
    this might work!!

    just tell me how to do it then?

    i'm familiar with Vlookup but not the way you did it. also i an unfamiliar with the advanced filter...

    see all the help i need??

    thanks again!

  18. #18
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Go to Data|Filter|Advanced Filter

    Select "Copy to another location"

    in the List Range enter (or select) the range to filter (Column A only).

    Leave Criteria range blank

    In the Copy to enter the top most cell reference where you want the data to go... it must be on the same sheet though. (You can copy/paste it later if you need to put in another sheet).

    Then apply the Vlookup formula... I used Column(B$2) as the 3rd (column Index) argument.. so that I can copy it across and it steps up to the next column number automatically.

  19. #19
    Registered User
    Join Date
    06-10-2008
    Location
    Overland Park KS
    Posts
    15
    okay i get the filter part - i'm confused on the VLookup now!! I'm still very new to Vlookup so I have only used it once or twice a couple different ways.

    THanks!!

  20. #20
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Quote Originally Posted by cclough27
    okay i get the filter part - i'm confused on the VLookup now!! I'm still very new to Vlookup so I have only used it once or twice a couple different ways.

    THanks!!
    Have a look at Vlookup in Excel help files.. it explains it well and gives examples... there are probably thousands of examples within this forum too!

  21. #21
    Registered User
    Join Date
    06-10-2008
    Location
    Overland Park KS
    Posts
    15
    do you know if i would be able to sum the income and premium i have for each pol_idx i have

  22. #22
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Take a look at Sumif in Excel Help... that is the function you want...

  23. #23
    Registered User
    Join Date
    06-04-2008
    Posts
    10

    Is this what you mean?

    Have added a column of data so I can use Min in the pivottable to count occurence of Pol_idx in each state

    Hope this is what you were after.

    Attached Files Attached Files

+ 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