Need to increment columns in a formula while dragging down...not across

haganator

New Member
Joined
Aug 5, 2008
Messages
42
Greetings all,

Is it possible to have a formula, that references a table in another worksheet, increment the column by dragging down? The formula is =MIN(SFLD_Stats!B$3:B$26), and I need to drag it down multiple cells so that it increments to =MIN(SFLD_Stats!C$3:C$26), and so forth. The row range is always 3:26, the column is the only thing that changes. I know that if I drag a formula down, the rows will update and if I drag across, the columns will update, but I need the opposite. I saw a way to use INDEX to do a swap like this for data points, but I don't know how to use it with a formula.

Any help would be greatly appreciated.

Thanks,

Jeff
 

par60056

Well-known Member
Joined
Jul 26, 2012
Messages
1,571
I can think of 3 ways to do it. None is what I would call elegant.

1) drag copy the formula horizontally, select the cells, copy, pastespecial transpose, clear the horizontal cells.
2) try a formula like =MIN(INDIRECT("Sheet1!" & ADDRESS(2,CELL("row",B3)-1) & ":" & ADDRESS(26,CELL("row",B3)-1)))
the formula assumes B3 is the cell the formula is in. So when you copy it down it becomes C3, D3, ...
3) write a macro to insert each formula

I hope somebody comes up with something better.
 

ukmikeb

Well-known Member
Joined
Jul 10, 2009
Messages
2,756
Hi

Try :-
Code:
=MIN(INDIRECT(ADDRESS(3,ROWS($1:2),2,,"SFLD_Stats")&":"&ADDRESS(26,ROWS($1:2),2)&""))
and drag down

hth
 

haganator

New Member
Joined
Aug 5, 2008
Messages
42
Par60056,

My apologies for not replying sooner...#2 worked. Thank you so much. I was debating on whether or not to swap rows and columns in my data tables, but that would've required a macro too. LOL. Kind of painted myself in a corner on this one.

Thanks again,

Jeff

I can think of 3 ways to do it. None is what I would call elegant.

1) drag copy the formula horizontally, select the cells, copy, pastespecial transpose, clear the horizontal cells.
2) try a formula like =MIN(INDIRECT("Sheet1!" & ADDRESS(2,CELL("row",B3)-1) & ":" & ADDRESS(26,CELL("row",B3)-1)))
the formula assumes B3 is the cell the formula is in. So when you copy it down it becomes C3, D3, ...
3) write a macro to insert each formula

I hope somebody comes up with something better.
 

haganator

New Member
Joined
Aug 5, 2008
Messages
42
ukmikeb,

Your solution is similar to #2 from the previous post. Yours worked like a champ...it took me a while to figure out how to step through it and be able to follow where I was in my table, but now it's a snap.

Thanks again,

Jeff

Hi

Try :-
Code:
=MIN(INDIRECT(ADDRESS(3,ROWS($1:2),2,,"SFLD_Stats")&":"&ADDRESS(26,ROWS($1:2),2)&""))
and drag down

hth
 

Jonmo1

MrExcel MVP
Joined
Oct 12, 2006
Messages
44,061
Glad you have a solution, but just wanted to add some value..

I was debating on whether or not to swap rows and columns in my data tables, but that would've required a macro too.
It's actually very easy to do that (without a macro)

Highlight and copy the entire range
Now go to an available area and Right Click - Paste Special - Transpose.
 

haganator

New Member
Joined
Aug 5, 2008
Messages
42
Jonmo1, This works really well. I'll have to play around with this to get used to it. Thanks for the info. Jeff
Glad you have a solution, but just wanted to add some value.. It's actually very easy to do that (without a macro) Highlight and copy the entire range Now go to an available area and Right Click - Paste Special - Transpose.
 

Forum statistics

Threads
1,082,335
Messages
5,364,686
Members
400,810
Latest member
elbashka

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top