Index Match with count if returning 0. Formula problem?

skyblue

New Member
Joined
Dec 6, 2012
Messages
3
Would like to sort the person's names in $F$33:$F$36 by a particular class they have enrolled in $J$33 from among several classes (e.g. class1, class2 etc.)$G$33:$G$36 and have the list of names appear of people taking just that class.

The formula I'm using is:

=INDEX($F$33:$G$36,MATCH(0,COUNTIF($H$39:$H39,$F$33:$F$36)+($G$33:$G$36<>$J$33),0),COLUMN(F1))

So, from a list of names (Jenny, Jane, Fred etc.) it would just output the people taking class 1 at $H$39:$H39. That is the goal.

I think my formula is close but is returning a 0. If anyone could help with this, it would be most appreciated.

I'm using the Mac version of excel 2010.
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Would like to sort the person's names in $F$33:$F$36 by a particular class they have enrolled in $J$33 from among several classes (e.g. class1, class2 etc.)$G$33:$G$36 and have the list of names appear of people taking just that class.

The formula I'm using is:

=INDEX($F$33:$G$36,MATCH(0,COUNTIF($H$39:$H39,$F$33:$F$36)+($G$33:$G$36<>$J$33),0),COLUMN(F1))

So, from a list of names (Jenny, Jane, Fred etc.) it would just output the people taking class 1 at $H$39:$H39. That is the goal.

I think my formula is close but is returning a 0. If anyone could help with this, it would be most appreciated.

I'm using the Mac version of excel 2010.
See if this is what you had in mind:

http://www.mrexcel.com/forum/showpost.php?p=2696961&postcount=3
 
Upvote 0
What you posted is exactly the type of thing I'm looking for. However, I typed in the values exactly in the same columns/rows as your example, but the formula keeps coming up with #NAME?


Thanks for your help!
Try this...

Book1
FGHIJKL
32____LookupCountNames
33Name1class1__class13Name1
34Name2class2____Name3
35Name3class1____Name4
36Name4class1_____
Sheet1

Enter this formula in K33. This will return the count of records that meet the criteria.

=COUNTIF(G33:G36,J33)

Enter this array formula** in L33:

=IF(ROWS(L$33:L33)>K$33,"",INDEX(F:F,SMALL(IF(G$33:G$36=J$33,ROW(G$33:G$36)),ROWS(L$33:L33))))

** array formulas need to be entered using the key
combination of CTRL,SHIFT,ENTER (not just ENTER).
Hold down both the CTRL key and the SHIFT key
then hit ENTER.

Copy down until you get blanks
 
Upvote 0

Forum statistics

Threads
1,216,084
Messages
6,128,728
Members
449,465
Latest member
TAKLAM

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