Large Function and Cell Address Problem

Brampton76

New Member
Joined
Nov 14, 2008
Messages
35
Good Morning,
I have identified the 2 largest numbers in a row using LARGE in a range A1:F1 with the answers in A3 and A4. Then I tried to identify the cell reference for each using using =CELL("address",INDEX($A$1:$F$1,MATCH(A3,$A$1:$F$1,0))) for the 1st and =CELL("address",INDEX($A$1:$F$1,MATCH(A4,$A$1:$F$1,0))) for the 2nd. But it returns $C$1 in both instances and I am not sure why and wondered if someone could explain please? And.......... help me towards a return of $C$1 and $D$1 which is where they both live.

Thank you
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Your formulas contain self referring addresses. I didn't get it. Try:

A3=CELL("address",INDEX($A$1:$F$1,MATCH(MAX(A1:F1),$A$1:$F$1,0)))
A4=CELL("address",INDEX($A$1:$F$1,MATCH(LARGE(A1:F1,2),$A$1:$F$1,0)))
 
Last edited by a moderator:
Upvote 0
Could you provide an example along with expected results?

M.

Many thanks for looking. Attached:

ABCDEF
$C$1$C$1
$C$1$D$1

<colgroup><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="align: right"]29[/TD]
[TD="align: right"]34[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]30[/TD]
[TD="align: right"]25[/TD]

[TD="align: center"]2[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]3[/TD]
[TD="align: right"]38[/TD]

[TD="align: center"]Expected Result[/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]4[/TD]
[TD="align: right"]38[/TD]

[TD="align: center"][/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]

</tbody>
Sheet1

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<thead>[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]
[TH="width: 10"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]A3[/TH]
[TD="align: left"]=LARGE($A$1:$L$1,1)[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]B3[/TH]
[TD="align: left"]=CELL("address",INDEX($A$1:$L$1,MATCH(A3,$A$1:$L$1,0)))[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]A4[/TH]
[TD="align: left"]=LARGE($A$1:$L$1,2)[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]B4[/TH]
[TD="align: left"]=CELL("address",INDEX($A$1:$L$1,MATCH(A4,$A$1:$L$1,0)))[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
Your formulas contain self referring addresses. I didn't get it. Try:

A3=CELL("address",INDEX($A$1:$F$1,MATCH(MAX(A1:F1),$A$1:$F$1,0)))
A4=CELL("address",INDEX($A$1:$F$1,MATCH(LARGE(A1:F1,2),$A$1:$F$1,0)))

Flashbond, many thanks for taking the time. Unfortunately, the result is the same, both A3 and A4 show $C$1.

Kind Regards
Glenn
 
Upvote 0
Try this array formula in B3 copied down
=CELL("address",INDEX(A$1:$F$1,SMALL(IF(A$1:F$1=A3,COLUMN(A$1:F$1)-COLUMN(A$1)+1),COUNTIF(A$3:A3,A3))))
Ctrl+Shift+Enter

M.
 
Upvote 0
Try this array formula in B3 copied down
=CELL("address",INDEX(A$1:$F$1,SMALL(IF(A$1:F$1=A3,COLUMN(A$1:F$1)-COLUMN(A$1)+1),COUNTIF(A$3:A3,A3))))
Ctrl+Shift+Enter

M.

M. Many thanks, it works a treat, awesome. I hadn't expected to see SMALL or COUNTIF in the formula so I had a look in the Help but I am not quite sure I fully understand the significance in the formula and wondered if you could explain please?

Many thanks
Glenn
 
Upvote 0
To see what the formula does, step by step, try
Select B3
Formulas > Evaluate formula

A brief explanation about the formula in B3
1. COLUMN(A$1:F$1)-COLUMN(A$1)+1 generates a horizontal array
{1,2,3,4,5.6}

2. The IF(A1:F1=B3, when B3 = 38, yields an array of True and False values like
{False,False,True,True,False,False}
So the IF results in
{False,False,3,4,False,False}

3. COUNTIF(B$3:B3,B3) results in 1

4. SMALL({False,False,3,4,False,False},1) results in 3

5, So INDEX(A1:F1,3) returns a reference to the third cell in the range: C1

6. At last, CELL("address",C1) ---> $C$1 as desired

How it works in B4?
The only difference is that COUNTIF(A$3:A4,A4) results in 2 and the SMALL function returns 4 (the second smallest); INDEX function returns a reference to fourth cell in the range: D1

M.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,917
Members
452,366
Latest member
TePunaBloke

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