Getting Max values of like cells in a Range

I

ibeetb

I have a 2 ranges both with 16 rows. 1 column has dates with just 4 dates
being repeated 4 times, which make up the 16 rows. The other column has
values that correspond to each of the dates.
I need a procedure to scroll through the dates and get the max value from
the value column of all LIKE dates.....

Is this possible
 
T

Tom Ogilvy

Assume the dates are in A1:A16 and are order the same in each group of 4.

Further assume the values to look at are in C1:C16


Sub Tester1()
Dim maxVal As Double
Set rng1 = Range("A1:A4")
i = 0
For Each cell In rng1
i = i + 1
maxVal = Application.Max(cell.Offset(0, 2), _
cell.Offset(4, 2), cell.Offset(8, 2), cell.Offset(12, 2))
Debug.Print cell.Text, maxVal
Next


End Sub
 
I

ibeetb

Hey Tom thanks....but it isn't exactly working and I think it is because I
didn't explain it properly. Here are two lists and I want to get the
Max(MaxHits) for each of the grp of dates: so the max value for 7/5 aND THE
mAX value for 7/12
Date MAXHits
7/5/2003 12200
7/5/2003 132
7/5/2003 87
7/5/2003 501
7/5/2003 294
7/5/2003 24
7/5/2003 333
7/5/2003 61
7/5/2003 500
7/5/2003 163
7/5/2003 1022
7/12/03 8459
7/12/03 208
7/12/03 200
7/12/03 490
7/12/03 295
7/12/03 45
7/12/03 407
7/12/03 42
7/12/03 592
7/12/03 213
7/12/03 1538
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top