What's causing error message?

J

Jim Tibbetts

Hello all,

The formula: =ADDRESS(2,MATCH(MAX(B2:AY2),A2:AY2,0),4) returns the cell
address (G2) of the largest number in B2:AY2 correctly.

The formula: =OFFSET(G2,-1,0) returns the name of the team in G1 that has
that highest total.

So why, when I replace the "G2" in the OFFSET formula with the ADDRESS
formula:
=OFFSET(ADDRESS(2,MATCH(MAX(B2:AY2),A2:AY2,0),4),-1,0) do I get an error
message?

Thanks for any ideas.
 
P

Peo Sjoblom

The error is cause because OFFSET can't take the textstring derived from a
formula and turn it into a
valid cell reference. You would need to use INDIRECT

=OFFSET(INDIRECT(ADDRESS(2,MATCH(MAX(B2:AY2),A2:AY2,0),4)),-1,0)


however this is not a good way to solve this, much better to use

=INDEX(A1:AY1,MATCH(MAX(B2:AY2),A2:AY2,0))

a much more efficient formula and it is not volatile either

--


Regards,


Peo Sjoblom
 
P

Peo Sjoblom

You are welcome, I notice that you probably have a typo, shouldn't this


MATCH(MAX(B2:AY2),A2:AY2,0)


be


MATCH(MAX(A2:AY2),A2:AY2,0))

?

--


Regards,


Peo Sjoblom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top