Help on use of INDIRECT command please

ShearJohn

New Member
Joined
Sep 8, 2002
Messages
16
Having been pointed at this command im having a little problem that you may be able to help me out with.

I have a formula in a cell part of which is

=INDIRECT((CHAR(CODE(B1)+1))&A6-1)

Where B1 is the column letter and A6 is the row number. Although probably very inelegant it does what I want it to up to row Z, after this it understandably goes awry. I cant seem to get the formula to work in the Excel R1C1 set up.(This might be because I use it so infrequently and dont understand it that well). Any help appreciated.

Thanks

John
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
On 2002-09-10 02:10, ShearJohn wrote:
Having been pointed at this command im having a little problem that you may be able to help me out with.

I have a formula in a cell part of which is

=INDIRECT((CHAR(CODE(B1)+1))&A6-1)

Where B1 is the column letter and A6 is the row number. Although probably very inelegant it does what I want it to up to row Z, after this it understandably goes awry. I cant seem to get the formula to work in the Excel R1C1 set up.(This might be because I use it so infrequently and dont understand it that well). Any help appreciated.

Thanks

John

Hi,

Welcome to the board,

First I have a question,
IF I put D in B1 and 3 in A6, the reference I'm actually refering to is E2,
I was just wondering why this is?
 
Upvote 0
Ian,

Thanks for the welcome, I didnt put the whole of the formula as some of it actualy works. The reason this bit does as you say is because it is part of an IF statement and differect cells need pointing to depending on the outcome. I hope that made sense!

Cheers
John
 
Upvote 0
On 2002-09-10 02:20, ShearJohn wrote:
Ian,

Thanks for the welcome, I didnt put the whole of the formula as some of it actualy works. The reason this bit does as you say is because it is part of an IF statement and differect cells need pointing to depending on the outcome. I hope that made sense!

Cheers
John

Still not sure,

but the following will do the same thing for you:

=OFFSET($A$1,A6-2,B1,1,1)

This will allow you to input numbers in B1 to reference the Columns as the B1 is just the number of columns to offset (also why you don't need +1 and you need -2 for the rows)

Regards,
 
Upvote 0
Ian Mac,

Sorry I didnt explain myself to well but you have more than adequately solved my problem, many thanks.

John
 
Upvote 0

Forum statistics

Threads
1,214,788
Messages
6,121,575
Members
449,039
Latest member
Arbind kumar

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