+ Reply to Thread
Results 1 to 4 of 4

Why is this formula removing duplicates?

  1. #1
    Registered User
    Join Date
    04-06-2012
    Location
    India
    MS-Off Ver
    Pro Plus 2019
    Posts
    86

    Why is this formula removing duplicates?

    hi!

    I have the following formula that removes blank cells from a column range.

    Code:

    =IF(ROWS(B$2:B2)>COUNTIF($A$2:$A$52,"?*"),"",INDEX ($A$2:$A$52,MATCH(1,INDEX(($A$2:$A$52<>"")*ISNA(MATCH($A$2:$A$52,$B$1:$B1,1)),0),0)))

    Problem is that each value is appearing uniquely in the result even though they might be appearing multiple times in the original range. Any suggestions to make the values appear sequentially in the order they appear and multiple times after removing blanks?

    Alternately, if someone has a better formula would appreciate if it can be shared.

    Following limitations may please be considered:
    1. No VBA/ Macros please since they are volatile and tend to disable undo option.

    2. No array formulas please (those committed with CTRL+SHIFT+ENTER), since my current solution already uses array formula and that has considerably slowed down calculations. My actual worksheet has about 100,000 cells with the array formula updated on a real time basis.

    3. The blank cells will actually not be blank but will be containing a formula and the cells are blank since the result of their calculation is blank.

    Sample file attached.

    Regards,

    Naira
    Attached Files Attached Files
    Last edited by naira; 05-07-2013 at 10:52 AM.

  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: Why is this formula removing duplicates?

    The attached example should not slow your workbook down in any way as it maintains your "results". By adding a "key" column to index the cells that should be collected, and noting in another cell the maximum index key value, the formulas in the RESULTS column are extremely fast.
    Attached Files Attached Files
    _________________
    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
    04-06-2012
    Location
    India
    MS-Off Ver
    Pro Plus 2019
    Posts
    86

    Re: Why is this formula removing duplicates?

    Quote Originally Posted by JBeaucaire View Post
    The formulas in the RESULTS column are extremely fast.
    Hi JBeaucaire,

    Thanks for your reply and yes, the formula are indeed extremely fast.
    Hope your solution would be found useful by others too who are till now dependent on arrays and macros.

    Thanks once again

  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: Why is this formula removing duplicates?

    I've marked this thread as SOLVED for you.
    Next time, select Thread Tools from the links above and mark this thread as SOLVED. Thanks.

+ 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