+ Reply to Thread
Results 1 to 11 of 11

Count cells in column only if Previous is not Duplicate

  1. #1
    Registered User
    Join Date
    10-07-2014
    Location
    USA
    MS-Off Ver
    2007
    Posts
    4

    Count cells in column only if Previous is not Duplicate

    I'd like to find a formula to count the number of non-blank entries in an entire column, but ONLY if the Previous cell is not a duplicate, and ONLY if the cell has EIGHT characters.

    In other words, for the data:

    AAAAAAAA
    BBBBBBBB
    CCCCCCCC
    CCCCCCCC
    DDDDDDDD
    DDDDDDDD
    CCCCCCCC
    DDDDDDDD
    EEEEEEEE
    FFFF

    The formula should count 7.
    Please let me know.

  2. #2
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Count cells in column only if Previous is not Duplicate

    I don't know how you get 7 as the count because there are only 6 unique items in the list with only 5 having 8 characters.

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  3. #3
    Registered User
    Join Date
    10-07-2014
    Location
    USA
    MS-Off Ver
    2007
    Posts
    4

    Re: Count cells in column only if Previous is not Duplicate

    Thank you for your reply, and sorry about the confusion. We're not looking for unique values. We want to count the number of cells in the column but ONLY if the Previous cell is not a duplicate, and ONLY if the cell has EIGHT characters.

    Also, there's no before and after sheet, as we simply want to enter the formula in a cell to the right of the column to calculate. Does this explanation below help?

    AAAAAAAA -> Count this cell
    BBBBBBBB -> Count this cell
    CCCCCCCC -> Count this cell
    CCCCCCCC -> Do NOT count, as previous cell above is same
    DDDDDDDD -> Count this cell
    DDDDDDDD -> Do NOT count, as previous cell above is same
    CCCCCCCC -> Count this cell because previous cell is NOT the same
    DDDDDDDD -> Count this cell because previous cell is NOT the same
    EEEEEEEE -> Count this cell
    FFFF -> Do NOT count, as it does not have 8 characters

  4. #4
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Count cells in column only if Previous is not Duplicate

    Maybe this is what you are looking for. The data starts in A2 and the formula is entered in B2 and copied down.

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    10-07-2014
    Location
    USA
    MS-Off Ver
    2007
    Posts
    4

    Re: Count cells in column only if Previous is not Duplicate

    Thank you, that does perform the count we need. Is it possible to have a single cell formula to accomplish this? I suppose we could hide the calculating column and capture the data from the last calculated cell in another visible cell. Thoughts?

  6. #6
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Count cells in column only if Previous is not Duplicate

    Try .. Arrayed Formula..
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Check the attached file..
    Attached Files Attached Files
    Regards,
    Vikas Gautam
    Excel-buzz.blogspot.com

    Excel is not a matter of Experience, its a matter of Application.

    Say Thanks, Click * Add Reputation

  7. #7
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Count cells in column only if Previous is not Duplicate

    Probably the easiest solution is to use is this simple formula

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  8. #8
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2504
    Posts
    13,620

    Re: Count cells in column only if Previous is not Duplicate

    Quote Originally Posted by equilter View Post
    Thank you, that does perform the count we need. Is it possible to have a single cell formula to accomplish this? I suppose we could hide the calculating column and capture the data from the last calculated cell in another visible cell. Thoughts?
    One of the greatest guys around here, named DonkeyOte, always advocated the use of a helper column when necessary. And, yes, hiding it is a good idea.

    Beware of array formulas, they will slow things down and get you in real trouble with larger spreadsheets

  9. #9
    Registered User
    Join Date
    10-07-2014
    Location
    USA
    MS-Off Ver
    2007
    Posts
    4

    Re: Count cells in column only if Previous is not Duplicate

    Thank you Vikas Gautam, that's perfect, and the Arrayed Formula works great!

  10. #10
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Count cells in column only if Previous is not Duplicate

    Thanks for the response Equilter..
    Thanks for the suggestion PEPE..
    Actually I just gave what OP wanted..
    I am a great Array Admirer, you now..


    Regards,
    Last edited by Vikas_Gautam; 10-07-2014 at 10:24 PM.

  11. #11
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2504
    Posts
    13,620

    Re: Count cells in column only if Previous is not Duplicate

    Well, as for me, I'm a great admirer of the KISS method

+ 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. [SOLVED] Move A column text to previous row if duplicate in B column
    By greek in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-05-2014, 12:06 AM
  2. [SOLVED] Count duplicate value in previous rows
    By drnszgy in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-04-2013, 08:45 PM
  3. count blank cells only if a 1 is previous
    By Directlinq in forum Excel General
    Replies: 9
    Last Post: 02-20-2009, 04:58 AM
  4. Replies: 6
    Last Post: 02-28-2008, 02:46 PM
  5. Replies: 9
    Last Post: 06-04-2007, 05:43 PM

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