Two max values in an array to show as reslut

asad

Well-known Member
Joined
Sep 9, 2008
Messages
1,434
I got the following table
Excel Workbook
AB
2SALTSIDIS hasn't paid in on more occassions than anybody else.
3
413/01/2011SANTIN H
527/01/2011SALTSIDIS
630/01/2011SALTSIDIS
73/02/2011OV
86/02/2011NOVOTNY
910/02/2011LAST
1010/02/2011SINGH R
1110/02/2011ARATHOON
1218/02/2011KEELEY
1319/02/2011PETERU
1421/02/2011OV
1522/02/2011FINDLAY
1623/02/2011SOK
1725/02/2011SANTIN J
1826/02/2011SANTIN J
1927/02/2011SINGH K
201/03/2011SINGH R
211/03/2011PETERU
223/03/2011SCHULZ
235/03/2011SALVATORE
245/03/2011OV
258/03/2011VA
268/03/2011SOK
27
2810/03/2011LAST
2914/03/2011SINGH R
3014/03/2011VA
3115/03/2011SINGH R
3217/03/2011SCHULZ
3320/03/2011SALTSIDIS
3423/03/2011SALTSIDIS
3524/03/2011SINGH K
361/04/2011DERUM
373/04/2011SALTSIDIS
385/04/2011DERUM
398/04/2011PETERU
4011/04/2011FINDLAY
4112/04/2011SALTSIDIS
4212/04/2011SINGH K
4314/04/2011LAST
4419/04/2011VA
4518/04/2011SINGH K
4619/04/2011SINGH K
4719/04/2011HOLT
4820/04/2011FINDLAY
4924/04/2011SINGH K
5026/04/2011SINGH K
5125/04/2011SALVATORE
5228/04/2011DERUM
5330/04/2011SINGH K
545/05/2011SINGH K
5522/05/2011SCHULZ
5624/05/2011RIVERA
5724/05/2011FINDLAY
5831/05/2011DERUM
5931/05/2011SANTIN H
601/06/2011SALEH
613/06/2011SANTIN H
626/06/2011DERUM
637/06/2011SANTIN H
647/06/2011FINDLAY
659/06/2011PETERU
6612/06/2011SINGH K
6710/06/2011DERUM
6818/06/2011ROFAEL
6919/06/2011SALTSIDIS
7021/06/2011SALEH
7121/06/2011LAST
7224/06/2011OV
7325/06/2011SALEH
7424/06/2011HOWARD
7527/06/2011SALTSIDIS
7628/06/2011SALTSIDIS
7728/06/2011SALTSIDIS
78
79
Not Paid In and Shortages


In the above, the answer should be "SINGH K, SALTSIDIS hasn't paid in on more occassions than anybody else". But it shows SALTSIDIS only. SINGH K and SALTSIDIS are both occurring 10 times. How can I fix this issue?

Thanks for your help.

Asad
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Thanks for coming to my aid Biff.
Date in k2 can be anything entered by a user, like 1/12/2011.
The original formula given by you required me to define the range Rng as $b$4:$b$500. B column has names of people. Column A has dates in it. If A55 has the same date as in k2 then I want Rng to be $b$55:$b500.
I will try tp post in some data tomorrow when I go to work.
Asad
 
Upvote 0
Thanks for coming to my aid Biff.
Date in k2 can be anything entered by a user, like 1/12/2011.
The original formula given by you required me to define the range Rng as $b$4:$b$500. B column has names of people. Column A has dates in it. If A55 has the same date as in k2 then I want Rng to be $b$55:$b500.
I will try tp post in some data tomorrow when I go to work.
Asad
Ok, I think I understand what you want to do.

Will the date that is entered in K2 appear only once in the data range?
 
Upvote 0
Ok, I think I understand what you want to do.

Will the date that is entered in K2 appear only once in the data range?

The date in K2 may or may not appear more than once in column A. But, if it does then it definitely will be in consecutive/successive rows. e.g. if k2 has 1/1/2011, it may appear in A56, A57 and A58 or if it is only once then it could be just in A80.
If it is appearing more than once, I want the range from the first row that it is appearing in. In the above example, it would be A56 as the other rows (A57, and A58) are after A56. So the range would be $A$56:$A$500.

Thanks for your patience Biff.

Asad
 
Upvote 0
The date in K2 may or may not appear more than once in column A. But, if it does then it definitely will be in consecutive/successive rows. e.g. if k2 has 1/1/2011, it may appear in A56, A57 and A58 or if it is only once then it could be just in A80.
If it is appearing more than once, I want the range from the first row that it is appearing in. In the above example, it would be A56 as the other rows (A57, and A58) are after A56. So the range would be $A$56:$A$500.

Thanks for your patience Biff.

Asad
Ok, to define the range use:

$B$500:INDEX($B$4:$B$500,MATCH($K$2,$A$4:$A$500,0))

If the date in K2 doesn't exist in A4:A500 then you'll get an error.
 
Upvote 0
I got the error when i inserted the formula to define the name range. I inserted it as
Code:
$B$5:INDEX($B$5:$B$500,MATCH($K$2,$A$5:$A$500,0))
here is the post
Excel Workbook
ABCDEFGHIJK
1DateDriverAmountDate Paid InFor dateDriverAmount
212#N/A#N/AStart27/01/2011
3#N/AEnd20/01/2012
4$ 5.00
513/01/2011SANTIN H$ 6.208/06/201113/01/2011SANTIN H$ 6.204
627/01/2011SALTSIDIS$ 33.5031/01/201127/01/2011SALTSIDIS$ 33.5024
730/01/2011SALTSIDIS$ 43.702/02/201130/01/2011SALTSIDIS$ 43.7024
83/02/2011OV$ 30.509/02/20113/02/2011OV$ 30.5014
96/02/2011NOVOTNY$ 45.409/02/20116/02/2011NOVOTNY$ 45.401
1010/02/2011LAST$ 67.1014/02/201110/02/2011LAST$ 67.105
Not Paid In and Shortages


And here is the post with original formula and Rng as
='Not Paid In and Shortages'!$B$5:$B$500

Excel Workbook
ABCDEFGHIJK
1DateDriverAmountDate Paid InFor dateDriverAmount
2241SALTSIDISStart27/01/2011
3SALTSIDIS Hasn't paid in on more occassions than anybody else.End20/01/2012
4$ 5.00
513/01/2011SANTIN H$ 6.208/06/201113/01/2011SANTIN H$ 6.204
627/01/2011SALTSIDIS$ 33.5031/01/201127/01/2011SALTSIDIS$ 33.5024
730/01/2011SALTSIDIS$ 43.702/02/201130/01/2011SALTSIDIS$ 43.7024
83/02/2011OV$ 30.509/02/20113/02/2011OV$ 30.5014
96/02/2011NOVOTNY$ 45.409/02/20116/02/2011NOVOTNY$ 45.401
1010/02/2011LAST$ 67.1014/02/201110/02/2011LAST$ 67.105
Not Paid In and Shortages


Why is that? May be I done something wrong.

Asad
 
Upvote 0
Got it now :).

It should have been
=INDEX('Not Paid In and Shortages'!$B$5:$B$500,MATCH('Not Paid In and Shortages'!$K$2,'Not Paid In and Shortages'!$A$5:$A$500,0)):'Not Paid In and Shortages'!$B$500

I entered it wrong. Thanks a lot for your help Biff.

Asad
 
Upvote 0
I also used this
Code:
=INDEX('Not Paid In and Shortages'!$B$5:$B$500,MATCH(LOOKUP('Not Paid In and Shortages'!$K$2,'Not Paid In and Shortages'!$A$5:$A$500),'Not Paid In and Shortages'!$A$5:$A$500,0)):'Not Paid In and Shortages'!$B$500
to avoid getting error if the date is not in the range.
It still is your formula but with a slight variation.

I learn everyday from this forum - Thanks to you people.

Asad
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,286
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top