Index Function

hoaianhthu

New Member
Joined
Aug 23, 2007
Messages
10
Hello there,
Below is my data example and I would like your help to write a fomular so it can return 2 stores for each region with the lowest rank. Can you please help? I try the index, but it seems not working with if condition. I already tried the array formular so that it can rank by region. Thanks for all of your helps.

thanks
Vivian



Store Region amount rank by region
197 1 63072.99 1
301 1 53032.32 2
133 1 36863.81 3
069 1 34736.26 4
300 1 33810.79 5
227 2 37891.7 1
109 2 35472.65 2
213 2 34936.23 3
233 3 42065.95 1
226 3 40145.01 2
192 4 41993.38 1
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
hi - welcome to the board!

You could get all elaborate with your forumulas, but I'd just use a pivot table - because your ranking from 1 = high to 5 = low etc, you can use the 'show top n' feature & set it to 2, then get rid of the subtotals etc
Book1
ABCDEFGHIJ
1StoreRegionamountrankSum of rank
2197163072.991RegionStorerankTotal
3301153032.32216944
4133136863.81330055
569134736.264210922
6300133810.79521333
7227237891.71322622
8109235472.65223311
9213234936.233419211
10233342065.951
11226340145.012
12192441993.381
13
Sheet2
 
Upvote 0
as you asked...
Book1
ABCDEFGHI
1StoreRegionamountrankRegionLowestNext lowest
2197163072.991130069
3301153032.3222213109
4133136863.8133226233
569134736.2644192#NUM!
6300133810.795
7227237891.71
8109235472.652
9213234936.233
10233342065.951
11226340145.012
12192441993.381
13
Sheet2



formula is:

INDEX($A$1:$A$12,MAX(IF($B$1:$B$12=$F2,IF($D$1:$D$12=LARGE(IF($B$1:$B$12=$F2,$D$1:$D$12),COLUMN()-6),ROW($A$1:$A$12)))))

...array entered in g2 & copied across / down
 
Upvote 0
It works perfect! Thanks you so much for your inputs! It is my first time to join the board and it is very helpful!

Vivian
 
Upvote 0

Forum statistics

Threads
1,214,948
Messages
6,122,420
Members
449,083
Latest member
Ava19

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