Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formula problems 1

Status
Not open for further replies.

andy7172289

Technical User
Aug 16, 2016
19
0
0
GB
Hi all,

Is anyone able to decipher the code below? I can get my head around INDIRECT, but the rest is jargon!

[highlight #FCE94F]=IF(ISERROR(INDIRECT("'"&HG$17&"'!M"&MATCH($A5,INDIRECT("'"&HG$17&"'!D:D"),0))),0,INDIRECT("'"&HG$17&"'!M"&MATCH($A5,INDIRECT("'"&HG$17&"'!D:D"),0)))[/highlight]

Thanks in Advance
 
Hi,

If you have Excel 2007 or greater, this will simplify...
[tt]
=IFERROR(INDIRECT("'"&HG$17&"'!M"&MATCH($A5,INDIRECT("'"&HG$17&"'!D:D"),0)),0)
[/tt]

So what does it mean:

HG17 must be a Sheet Name
MATCH returns a row offset number that when concatenated with M, results in an A1 style reference to a cell in column M like M1.

Then the INDIRECT converts the text of “SheetName!M1” for instance into a cell reference.

The same thing happens in the MATCH function, where the lookup range is returned from the text of “SheetName!D:D

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top