Changing Column Location in Excel Formula

dwg83

Board Regular
Joined
Nov 8, 2006
Messages
174
I have a multitude of worksheets that contain the same columns of data, just not always in the same columns. What I intend to do is have a cell dedicated (P1) to entering the number of the column of the data I want to appear in Column P. What do I need to have in my formulae (P2-P1000) in order to refer to the column number listed in P1 and the row value of the current cell?

Thanks
David
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
What are you wanting to do with this data? If you want to sum it, you could do as so:

=sum(offset($a$1,row()-1,p1-1,1000))

I think this may be what you are looking for?

It offsets a1 by the active row - 1 since you are starting in row 1 and then offsets the column by value in p1 - 1 since you start in column 1 and then makes the length 1000?
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,758
Members
452,940
Latest member
rootytrip

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