offset return

CreativeRova

New Member
Joined
Dec 12, 2013
Messages
49
Hi,

i have a table that i want to extract from. 1st 2nd 3rd etc

eg

team
average
position
TEAM
GIANTS
1.000
FIRST
TWINS
0.000
SECOND
RED SOX
0.750
THIRD
METS
0.500
FOURTH

<tbody>
</tbody>

See above. in B5 i want it to automatically choose the highest average team and display the team name.
i.e - First will be Giants as their average is highest.
I know the formula to sort hjighest is large(b2:b5,1) and so on but that return the average not the team name how do i use the offset formula with LARGE to return the name?
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Try.
Assumes there are not duplicate averages.
Copy formula down as needed.

Excel Workbook
ABCDEF
1teamaveragepositionTEAM
2GIANTS1FIRSTGIANTS
3TWINS0SECONDRED SOX
4RED SOX0.75THIRDMETS
5METS0.5FOURTHTWINS
6
Sheet1
 
Upvote 0
My suggestion would be to add a sort code in column C.

Suppose your data is in rows 2:30, add the following array formule in C2 (confirm with CTRL-SHIFT-ENTER, not just ENTER) and copy down:
Code:
 =1+SUM(--($B$2:$B$30>B2))+SUM(--(B$1:B1=B2))

Now enter in E2 the following formula and copy down:
Code:
 =INDEX($A$2:$A$30,MATCH(ROW(E2)-ROW(E$2)+1,$C$2:$C$30,0))

For the position (in numbers and including duplicates) you can use the following array formula in D2 (confirm with CTRL-SHIFT-ENTER, not just ENTER) and copy down:
Code:
 =1+SUM(--($B$2:$B$30>INDEX($B$2:$B$30,INDEX(E2,$A$2:$A$30,0))))
 
Upvote 0
Small correction, the last code (in D2) should be:
Code:
 =1+SUM(--($B$2:$B$30>INDEX($B$2:$B$30,[B]MATCH[/B](E2,$A$2:$A$30,0))))
[/
 
Upvote 0
Hi MarcelBeug,

That worked perfectly. Never seen that code before and the third code for position didn't seem to work for me but that fine since it is sorting the data highest to lowest i know what positions each is in.
 
Upvote 0
Small correction, the last code (in D2) should be:
Code:
 =1+SUM(--($B$2:$B$30>INDEX($B$2:$B$30,[B]MATCH[/B](E2,$A$2:$A$30,0))))
[/

Hi MarcelBeug, great work, really helpful.

Just two quick question, would there be any way to change the Position from numbers to say First, Second, Third etc?

Another question, would there be any way to have equal places; say two fourth, and then the position number would skip to six?

If not all good, just that may be easier in some cases, thankyou
 
Last edited:
Upvote 0
Hi MarcelBeug,

That worked perfectly. Never seen that code before and the third code for position didn't seem to work for me but that fine since it is sorting the data highest to lowest i know what positions each is in.

Hi CreativeRova, it did work for me after some love.
Copy and pasting didn't work for me. First, click on D2; then in the formula box above past the formula. I then went to the front of the formula and deleted the =1+SUM, and then redid the =sum, click on the sum button which appeared, then added the 1+, and then confirm with CTRL-SHIFT-ENTER, not just ENTER.
Really good formulas to have up your sleeve.
 
Upvote 0

Forum statistics

Threads
1,216,096
Messages
6,128,809
Members
449,468
Latest member
AGreen17

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