using Indirect function

ardykav

Board Regular
Joined
Oct 18, 2015
Messages
172
Office Version
  1. 365
Platform
  1. Windows
Hi All,

I am trying to use an indirect function but am making an error somewhere. Can anyone please advise?

So cell AG2 has the number 25 in it, what i want is the function to look up the controls tab at cell A25.

=IF(H4=0, "",INDIRECT("'"&"Controls!$A"&AG2&"'!"&"C27"))

Does this make sense?

thanks in advance
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Because you have no spaces in your sheet name, you don't need to use """

If I read it correctly, the Indirect part you need is:

=INDIRECT("Controls!A" & AG2)

That assume AG2 is on 'this' sheet, not Controls sheet.

=IF(H4=0, "",INDIRECT("Controls!A" & AG2))

If AG2 contains 25, the formula would evaluate as

=Controls!A25

Is that what you need?
 
Upvote 0
Because you have no spaces in your sheet name, you don't need to use """

If I read it correctly, the Indirect part you need is:

=INDIRECT("Controls!A" & AG2)

That assume AG2 is on 'this' sheet, not Controls sheet.

=IF(H4=0, "",INDIRECT("Controls!A" & AG2))

If AG2 contains 25, the formula would evaluate as

=Controls!A25

Is that what you need?

Thats perfect thanks so much. So how do i then incorporate the Cell C27 look up?
 
Upvote 0
What are you trying to do with C27? If concatenate with ControlsA25?

Example:
=INDIRECT("Controls!A" & AG2) & C27

will evaluate as

=Controls!A25 & C27
Insert a space between results and wrap that inside your If test:

=IF(H4=0, "",INDIRECT("Controls!A" & AG2) & " " & C27)
 
Last edited:
Upvote 0
What are you trying to do with C27? If concatenate with ControlsA25?

Example:
=INDIRECT("Controls!A" & AG2) & C27

will evaluate as

=Controls!A25 & C27
Insert a space between results and wrap that inside your If test:

=IF(H4=0, "",INDIRECT("Controls!A" & AG2 & " " & C27))

Yes thats right, that formula you had is perfect, all works great, thank you very much
 
Upvote 0

Forum statistics

Threads
1,223,646
Messages
6,173,531
Members
452,520
Latest member
Pingaware

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