Return Range for Formula

lym13

New Member
Joined
Sep 12, 2006
Messages
1
I have a rows of data that starts at column C and are of varying lengths. ie. some data goes to column F while other data goes to column AY. The data is constantly changing and I would like to perform a MAX function on each row of data without having to change the range manually everytime an extra cell of data is added to the row.

Is there a way that I can look from say cell A3 until I find a blank cell and then return the range that contains data ie A3:AY3 and perform the MAX function on that range?

Thanks
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.

SydneyGeek

MrExcel MVP
Joined
Aug 5, 2003
Messages
12,251
You can do it by creating a dynamic range. Here's how:

Assuming that data starts in C3, place the cursor in A3 and then --
1. Insert > Name > Define
2. In the top row of the dialog, enter ThisRow
3. Replace the last row of the dialog with this:
Code:
=OFFSET(Sheet1!$C3,0,0,1,COUNTA(Sheet1!$C3:$IV3))
Note: Make sure the sheet reference is correct! If your sheet has more than 1 word in the name, refer to it like ='Sheet 23'!$C3
4. Press Add, then OK.

In A3 of the worksheet, enter =MAX(ThisRow) and fill down.

Denis
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,209
I have a rows of data that starts at column C and are of varying lengths. ie. some data goes to column F while other data goes to column AY. The data is constantly changing and I would like to perform a MAX function on each row of data without having to change the range manually everytime an extra cell of data is added to the row.

Is there a way that I can look from say cell A3 until I find a blank cell and then return the range that contains data ie A3:AY3 and perform the MAX function on that range?

Thanks

Cheaper to run...

=MAX(A3:IV3)
 

Forum statistics

Threads
1,141,670
Messages
5,707,730
Members
421,525
Latest member
carian1980

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
Top