+ Reply to Thread
Results 1 to 9 of 9

Identifying Most to Least with up to 8 duplicates

  1. #1
    Registered User
    Join Date
    04-01-2015
    Location
    Desktop
    MS-Off Ver
    07,10,13
    Posts
    38

    Question Identifying Most to Least with up to 8 duplicates

    Hi Friends,

    I am trying to identify/Rank some results (with Excel 2010) from the Most occurrences (Count (Col B)) to the Least. In the attached workbook the data is in Columns A, B, C just for testing. The actual data in my report runs horizontally (Cols F-EF).

    I tried a bunch of formulas working with Large and multiple duplicates but I don't seem to be applying them correctly because I am ending up with either duplicates or #NUM!'s

    Thanks in advance for any help you can offer and for taking the time to read this.

    Best,

    Bambu

    -> See Current Workbook in Newer Posts below to save time. Thanks <-
    Attached Files Attached Files
    Last edited by AliGW; 07-12-2022 at 04:28 AM. Reason: Irrelevant section of title removed.

  2. #2
    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: (Large) Help identifying Most to Least with up to 8 duplicates

    Try this in F3 and copy across until you get blanks.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Please note that this works only in the 2010 version specified. Other versions would require
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    and you would need to array enter it.

    If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.
    Dave

  3. #3
    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: (Large) Help identifying Most to Least with up to 8 duplicates

    My apologies. I overlooked the "data runs horizontally" part.

    Try this in F2 and copy across until you get blanks.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    You were likely having problems because the output of FREQUENCY is a single column array (all rows) and the source data is oriented as single row. (The secret in this case is in transposing the data.)

    See the attached.

  4. #4
    Registered User
    Join Date
    04-01-2015
    Location
    Desktop
    MS-Off Ver
    07,10,13
    Posts
    38

    Re: (Large) Help identifying Most to Least with up to 8 duplicates

    Hi, Dave (Flame)

    Thanks for your time. I forgot about Aggregate and Frequency (I've used them a few times to solve past problems). I tested your 1st formula for 2010. It works great, unfortunately, I didn't do a good enough job explaining what I am trying to do or the desired result.

    The end result is that I am trying to match my Collection Name's to their totals and... have the results output the data from either ascending/descending order (which is Left to Right in this case because that is actually the way the Real data is in the grid).

    I have been working on this myself and am very close to a solution. I thought I did figure it out but there was a typo in the formula that I was modeling that FDibbins (Ford) posted a couple years ago to help someone.
    My Formula (TieBreakerCount) seems to work but Excel is throwing me [Formula Omits Adjacent Cells]Please Login or Register to view this content.[/FORMULA]
    When I "Fix it" to what it should be and what Fibbins Posted all of my other formulas (Match & Index) blow up/break (#N/A).
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    This New Workbook has my most recent work. I hope it better explains what I am doing.

    (I started drafting this after your 1st post. I've since seen your 2nd and yeah transpose fixed the horizontal issue with those formulas, but it's not the the solution I was seeking because it excludes data)
    Attached Files Attached Files
    Last edited by Bambu; 07-11-2022 at 05:19 PM.

  5. #5
    Valued Forum Contributor
    Join Date
    07-23-2013
    Location
    London, England
    MS-Off Ver
    Office 365
    Posts
    988

    Re: (Large) Help identifying Most to Least with up to 8 duplicates

    The Excel warning about omitting adjacent cells is nothing to worry about in this case...it's intentional.

  6. #6
    Registered User
    Join Date
    04-01-2015
    Location
    Desktop
    MS-Off Ver
    07,10,13
    Posts
    38

    Re: (Large) Help identifying Most to Least with up to 8 duplicates

    Hi Nick,

    Thanks for taking the time to look at this. Wouldn't be the 1st time I blindly stumble onto/into an answer. "It's not a bug it's a feature !!!"

    So far this has been the only way I've figured out to do it, which really means nothing. I'm not an Excel Rock Start like so many of you generous people here.

    Thanks,

    Bambu

  7. #7
    Valued Forum Contributor
    Join Date
    07-23-2013
    Location
    London, England
    MS-Off Ver
    Office 365
    Posts
    988

    Re: (Large) Help identifying Most to Least with up to 8 duplicates

    To explain a bit more, for your tiebreaker, the formula =D3+COUNTIF($D3:D$151,D3)/1000 copied down as you have used works fine. Personally I find it easier to follow to have the "locked" cell at the top rather than the bottom, so I would use =D3+COUNTIF(D$3:D3,D3)/1000 copied down instead. Or another way I often do it is to use the row, e.g. =D3+ROW(D3)/1000. Or if you want it to start counting from 1 then =D3+(ROW(D3)-ROW($D$3)+1)/1000.

    As far as I understand though, the sheet you have is already giving you the desired results - if that's not correct then let us know

  8. #8
    Registered User
    Join Date
    04-01-2015
    Location
    Desktop
    MS-Off Ver
    07,10,13
    Posts
    38

    Re: Identifying Most to Least with up to 8 duplicates

    Hi Nick,

    I agree
    so I would use =D3+COUNTIF(D$3:D3,D3)/1000 copied down instead
    but like I said if you make the top absolute the other formulas (RANK, MATCH, and INDEX) break.

    Is it (why the formulas break) because when using MATCH the data should be sorted in a particular way (I think I read something like that NOT recently but in my travels) ???
    If that's the case all of this sorting and resorting kind of seems like a pivot table thing but that's just a guess/thought.

    I've used ROW to do my bidding before but I guess the fact that the data is horizontal is throwing me (we would do Range(Cell(Row,C), Cell(Row,C)) in VBA so ). I will have to try it when I circle back on this particular issue.

    I was thinking about it last night once I started writing the code for this "I probably should just get the info from a pivot table !!!" It's already in a TABLE and pivot tables do make slicing and dicing data easier. The con is that pivot tables come with their own set of problems and limitations.

    In closing, my formula (tiebreaker) appears to work but I don't trust it nor do I think it's the best (most efficient if even accurate) formula(s) to get what in the end is an IndexMatch for my pokemon collection.

    I have to test your formulas Nick (they look like they will work perfectly) when I get a moment but without getting into the weeds . I'm working on a few different projects right now and had to jump back on a project I put down to work on this one.

  9. #9
    Valued Forum Contributor
    Join Date
    07-23-2013
    Location
    London, England
    MS-Off Ver
    Office 365
    Posts
    988

    Re: Identifying Most to Least with up to 8 duplicates

    In your example for most cells you have the bottom cell absolute e.g. $D4:D$151 in E4. This means the range always goes from the current row to the bottom of the range. Where you have (I think) tried to change it in row 3 you have used $D$3:D151. This is incorrect and should be $D$3:D3. That's why the formulae break - as you have it the whole range (rows 3 to 151) are always counted (along with some more rows off the bottom as you copy it down) which means it does not break ties, which leads to the errors.

    If you're using horzontal data you can just use COLUMN instead of row, if that helps.

    Yes, it is somewhat overcomplicated...you could use this in I3 to sort the count:

    =LARGE($D$3:$D$151,C3)

    And this in H3 to get the collection name:

    =INDEX($B$3:$B$151,SMALL(IF($D$3:$D$151=I3,$C$3:$C$151),COUNTIF($I$3:I3,I3)))

    Both copied down.

    The tiebreakercount, rank, match columns then become redundant.

+ 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. Identifying Duplicates
    By Revathi kannan in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-29-2022, 02:10 AM
  2. Identifying Duplicates
    By rakul_rakul in forum Excel General
    Replies: 1
    Last Post: 01-28-2022, 05:36 AM
  3. Replies: 5
    Last Post: 08-28-2018, 04:47 PM
  4. Identifying Duplicates
    By WillBoyce in forum Excel General
    Replies: 2
    Last Post: 10-01-2016, 08:02 AM
  5. [SOLVED] Identifying Duplicates
    By vidyasankar in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-08-2014, 11:00 AM
  6. Identifying Duplicates
    By laurance in forum Excel General
    Replies: 2
    Last Post: 05-27-2009, 06:19 AM
  7. Identifying Duplicates
    By Daywalker in forum Excel General
    Replies: 2
    Last Post: 02-16-2007, 05:27 PM

Tags for this Thread

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