Alpha Sort INDEX MATCH with Condition

snt20147

New Member
Joined
Nov 1, 2018
Messages
1
Hello! I want to use INDEX MATCH using Table 1 to create Table 2 that displays only "Winter" and sorts the month alphabetically. I used the following formula which did a great job of sorting by month, but I can't figure out how to get it to select only "Winter".

=INDEX(Month,MATCH(ROWS($C$2:C2),COUNTIF(Month,"<="&Month),0))

Thanks in advance for looking at my post!

Table 1
RankIDMonthSeason
1123JanuaryWinter
2234FebruaryWinter
3345AugustSummer
1456AprilSpring
2567MaySpring
3678JuneSpring
3102SeptemberFall
1789JulySummer
2901MarchWinter


<colgroup><col span="2"><col><col></colgroup><tbody>
</tbody>
Table 2
Month


Season
FebruaryWinter
JanuaryWinter
MarchWinter

<colgroup><col><col></colgroup><tbody>
</tbody>
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
If you use helper columns I and J in my example, you can pull all winter records. Then you can use your formula on that to sort.

Book1
ABCDEFGHIJ
1RankIDMonthSeasonmonthSeasonmonthSeason
21123JanuaryWinterFebruaryWinterJanuaryWinter
32234FebruaryWinterJanuaryWinterFebruaryWinter
43345AugustSummerMarchWinterMarchWinter
51456AprilSpring#NUM!#NUM!
62567MaySpring#NUM!#NUM!
73678JuneSpring#NUM!#NUM!
83102SeptemberFall#NUM!#NUM!
91789JulySummer#NUM!#NUM!
102901MarchWinter#NUM!#NUM!
Sheet1
Cell Formulas
RangeFormula
F2{=IF(ROWS(F$2:F2)>COUNTIF($D$2:$D$10,"winter"),"",INDEX($I$2:$I$9,MATCH(ROWS($I$2:I2),COUNTIF($I$2:$I$9,"<="&$I$2:$I$9),0)))}
G2{=IF(ROWS(F$2:F2)>COUNTIF($D$2:$D$10,"winter"),"",INDEX($J$2:$J$9,MATCH(ROWS($J$2:J2),COUNTIF($I$2:$I$9,"<="&$I$2:$I$9),0)))}
I2{=IF(ROWS(F$2:F2)>COUNTIF($D$2:$D$10,"winter"),"",INDEX($C$2:$C$10,SMALL(IF($D$2:$D$10="winter",ROW($D$2:$D$10)-ROW($D$2)+1),ROWS($I$2:I2))))}
J2{=INDEX($D$2:$D$10,SMALL(IF($D$2:$D$10="winter",ROW($D$2:$D$10)-ROW($D$2)+1),ROWS($I$2:J2)))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Hi,

=LOOKUP(1,0/FREQUENCY(ROWS(C$2:C2),COUNTIFS(Season,Season,Season,"Winter",Month,"<="&Month)),Month)

No need for CSE.

Regards
 
Upvote 0

Forum statistics

Threads
1,213,496
Messages
6,113,995
Members
448,539
Latest member
alex78

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