ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Using the MAX function with "constant increment" cell references (https://www.excelbanter.com/excel-worksheet-functions/7754-using-max-function-%22constant-increment%22-cell-references.html)

John Dwyer

Using the MAX function with "constant increment" cell references
 
I'd like to return the maximum value for every 12th cell
in a very long column of values. i.e. MAX
(BC2,BC14,BC26,BC38,BC50....) Can I do this using the MAX
function without listing each individual cell reference in
the function argument? If not, is there another way to do
this?

Thanks much,
John

JE McGimpsey

One way (array-entered: CTRL-SHIFT-ENTER or CMD-RETURN):

=MAX(IF(MOD(ROW(B1:B1000),12)=2,B1:B1000,""))




In article ,
"John Dwyer" wrote:

I'd like to return the maximum value for every 12th cell
in a very long column of values. i.e. MAX
(BC2,BC14,BC26,BC38,BC50....) Can I do this using the MAX
function without listing each individual cell reference in
the function argument? If not, is there another way to do
this?

Thanks much,
John


Ben McBen

How about the below. BTW I have a tendency to do
things "by hand" there may be an easier way another
memeber can suggest


Public Function MaxRange(RangeToParse As Range, JumpSize
As Integer)

Dim aCell As Range
Dim MaxVal
Dim i

For Each aCell In RangeToParse

If i Mod JumpSize = 0 Then

If aCell MaxVal Then
MaxVal = aCell
End If

End If

i = i + 1

Next aCell

MaxRange = MaxVal

End Function


Max

One way is to strip the values of all the 12th cells
into say, another sheet ..

Assuming the data is in Sheet1, col BC

In Sheet2
-------------
Put in A1: =INDIRECT("'Sheet1'!BC"&ROW(A1)*12-10)

Copy down

This'll extract contents of Sheet1's
BC2,BC14,BC26,BC38,BC50 ..
into col A

Then just put in B1: =MAX(A:A)
should do it
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
"John Dwyer" wrote in message
...
I'd like to return the maximum value for every 12th cell
in a very long column of values. i.e. MAX
(BC2,BC14,BC26,BC38,BC50....) Can I do this using the MAX
function without listing each individual cell reference in
the function argument? If not, is there another way to do
this?

Thanks much,
John





All times are GMT +1. The time now is 02:46 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com