Indirect Formula to change row bumber when coping it from from left to Right

howard

Well-known Member
Joined
Jun 26, 2006
Messages
6,563
Office Version
  1. 2021
Platform
  1. Windows
I have the following formula in cell C2 which yields the correct result

Code:
 =INDEX(INDIRECT("'C:\My Documents\["&$B$2&"]"&$H$1&"'!d4"),0,ROWS($D4:D4))

when i copy it in cell C3 the formula must look at Cell D5 in the source workbook. when i copy it in cell C4 the formula must look at Cell D6 in the source workbook etc

It would be appreciated if someone could kindly assist me
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Hi Howard,

Try
Excel Formula:
=INDEX(INDIRECT("'C:\My Documents\["&$B$2&"]"&$H$1&"'!d"&ROW()+2),0,ROWS($D4:D4))
 
Upvote 0
Thanks for the help

My Apologies for giving you the incorrect info

The Formula below in C3 refers to Cell D4 in the source workbook. when Copied to D3 it must refers to D5 , when copied to E3 , it must refer to D6 etc

Code:
=INDEX(INDIRECT("'C:\My Documents\["&$B$2&"]"&$H$1&"'!d"&ROW()+2),0,ROWS($D4:D4))


Kindly amend your code
 
Upvote 0
Does this do what you ask?
Excel Formula:
=INDEX(INDIRECT("'C:\My Documents\["&$B$2&"]"&$H$1&"'!d"&COLUMN()+1),0,ROWS($D4:D4))

1622200525068.png
 
Upvote 0
thanks very much for your help. Code works perfectly
 
Upvote 0

Forum statistics

Threads
1,214,991
Messages
6,122,628
Members
449,095
Latest member
bsb1122

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