Sat 09 Dec 2017

Solution - Challenge 67 - Find Duplicates and Show the Count

By |Saturday, December 09th, 2017|Categories: Solutions|Tags: , , |0 Comments

Below is a possible solution to the problem Challenge 67 - Find Duplicates and Show the Count

Use a helper column in which put following formula -

=LEFT(SUBSTITUTE(IF(ISNUMBER(FIND("(",A2)),SUBSTITUTE(A2,"("," "),SUBSTITUTE(A2&"-","-","%")),
" ","%",2),FIND("%",SUBSTITUTE(IF(ISNUMBER(FIND("(",A2)),SUBSTITUTE(A2,"("," "),
SUBSTITUTE(A2&"-","-","%"))," ","%",2))-1)

In the last column, put following formula -

=IF(COUNTIF($B$1:B2,B2)=1,COUNTIF(B:B,B2),"")

The solution work can be downloaded from Solution - Find Duplicates and Show the Count

Thu 09 Nov 2017

Challenge 67 - Find Duplicates and Show the Count

By |Thursday, November 09th, 2017|Categories: Challenges|Tags: , , |2 Comments

You have been given following data and you need to show corresponding count. You need to write a formula which can generate this count. If needed, you can use a maximum of helper column also.

Download problem workbook from Find Duplicates and Show the Count

The solution to this problem will be published after a month i.e. on 9-Dec-17.

Sat 06 Feb 2016

Tips & Tricks 129 - Generate Non Repeating Random Numbers through Formula

By |Saturday, February 06th, 2016|Categories: Tips and Tricks|Tags: , , , |0 Comments

Suppose, you want to generate non-repeating random numbers between 1 to 30, you can use following formula in A2 and drag down

=IFERROR(AGGREGATE(14,6,ROW($1:$30)*NOT(COUNTIF($A$1:$A1, ROW($1:$30))),
RANDBETWEEN(1,30-ROWS($1:1)+1)),"")

Note: $A$1:$A1 is with reference to A2 as you put formula in A2 and dragged down. Suppose, you had put the formula in G4, this should be replaced with $G$3:$G3.

If your starting and ending numbers are in B1 and C1, use below formula

=IFERROR(AGGREGATE(14,6,ROW(INDIRECT($B$1&":"&$C$1))*
NOT(COUNTIF($A$1:$A1,ROW(INDIRECT($B$1&":"&$C$1)))),
RANDBETWEEN($B$1,$C$1-ROWS($1:1)+1)),"")

For versions, prior to 2010 following basic construct can be used (Build error handling depending upon the version. For example, Excel 2007 will support IFERROR whereas 2003 supports ISERROR) -

=LARGE(INDEX(ROW($1:$30)*NOT(COUNTIF($A$1:$A1, ROW($1:$30))),,),
RANDBETWEEN(1,30-ROW(A1)+1))

Sat 02 Jan 2016

Article 33 - Rank when Duplicates Exist (Ties)

By |Saturday, January 02nd, 2016|Categories: Articles|Tags: , , , , , |0 Comments

Ranking when duplicates (ties) exist is an interesting problem and you will be called upon to make choices when duplicates exist and you have to rank them. Suppose, you have the data like below. 2 rows are formatted in Yellow and 3 rows are formatted in Green to demonstrate the existence of duplicates.

1

(more…)

Sat 22 Aug 2015

Tips and Tricks 106 - Find the nth Largest Number when there are duplicates

By |Saturday, August 22nd, 2015|Categories: Tips and Tricks|Tags: , , , , |0 Comments

You know the LARGE function which can find the nth largest value. Hence, if you have a series like below -

1

And you give =LARGE(A1:A10,3), you get the answer as 18

Now, if we have a series like below

1

Now, you give =LARGE(A1:A10,3) and now the result is 24. The reason is that large function gives the nth largest value in a sorted array. Hence, LARGE function will sort the above array as {24,24,24,22,22,18,18,9} and 3rd largest is 24.

But actually you want the unique 3rd largest which is 18 as the answer.

The formula for such case would be

=LARGE(IF(FREQUENCY($A$2:$A$10,$A$2:$A$10)<>0,$A$2:$A$10),3)