Array formula to list all People with certain eye color returning blank cells.

Tyron

Active Member
Joined
Dec 5, 2012
Messages
258
Hey everyone,

It seems to me that I am getting strange output of an excel formula and for the life of me I can't figure out why. Could someone explain why I am getting these results?

The goal of this array formula is to list all the first names of the people with a certain eye color. In this example Blue

only one worksheet is being used for the use of this question:
ABC
4Color:Blue
First Name
Last Name
8
9
10
11#NUM!#NUM!
12#NUM!#NUM!
13#NUM!#NUM!
31Color
First Name
Last Name
32BlueRonaldWashington
33GreenMaryRamirez
34BluePeteRogers
35BlueSusieMcNickel

<tbody>
</tbody>
The value in B4 is a data validation list box that has the different eye colors in it. They are Blue, Brown, Green

The formula that I am using in A8 through A10 is as follows:
Code:
{=INDEX($A$32:$C$106,SMALL(IF($A$32:$A$106=$B$4,ROW($A$32:$A$106)),ROW(A8:A8)),2)}
I ensured using the CTRL+SHIFT+ENTER keys in order to make this an Array formula and the formula changes to show ROW(2:2) and ROW(3:3) at the ends of the formula in A9 and A10.
For some reason as you can see above it has a blank cell for the values.

I did try one other formula that I found on the web:
Code:
=INDEX($B$32:$B$106, SMALL(IF(ISNUMBER(SEARCH($B$4, $A$32:$A$106)), MATCH(ROW($A$32:$A$106), ROW($A$32:$A$106))), ROW(A8)))
But I just end up with an error. When I say to trace the error I get a pop-up that says: "The Error Tracer encountered existing arrows or a circular reference. Delete all tracer arrows or resolve the circular reference, and then choose Trace Error again." Only I can't find any arrows like you normally do. I guess I am not understanding why the formula is referring to the different ranges.

All help is appreciated as I have been struggling with this for the last week.

later

Ty
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
There is no need to apply an array formula if you use one more column as under:
Please add the following formula in Column "D" (Copy D32 to D33:D106)
D32=IF(A32=$C$2,ROW(A1),"X")
Then use the following formula A8 and B8 and copy as required:
A8=IFERROR(INDEX($A$32:$C$106,MATCH(SMALL($D$32:$D$106,ROW(A1)),$D$32:$D$106,0),2),"")
B8=IFERROR(INDEX($A$32:$C$106,MATCH(SMALL($D$32:$D$106,ROW(B1)),$D$32:$D$106,0),3),"")

Regards.

A.B. Mati
Doha Qatar
 
Upvote 0
Tyron,

Two things....

ROW(A8:A8) will always resolve to 1
ROW($A$32:$A$106) will generate values 32 to 106, actual row numbers, whereas you want row relative to the range A32:C106 therefore need subtract 31


Excel 2007
AB
4Color:Blue
5First NameLast Name
6
7
8Ronald
9Pete
10Susie
11
12
Sheet3
Cell Formulas
RangeFormula
A8{=IFERROR(INDEX($A$32:$C$106,SMALL(IF($A$32:$A$106=$B$4,ROW($A$32:$A$106)-31),ROWS(A$8:A8)),2),"")}
Press CTRL+SHIFT+ENTER to enter array formulas.


Hope that helps.
 
Upvote 0
Hey Abmati,

Thanks for your suggestion. Although I am confused to one thing. In D32 you indicated to copy a formula that indicates IF(A32=$C$2,ROW(A1),"X"). What is the value of C2 refering to?

Thanks in advance

Ty
 
Upvote 0
Hey Tony,

Thanks. This works like a charm. Hopefully I can find a way to better understand this formula as it seems a bit elusive as to why I needed to write it that way.

I think it is how the SMALL function is used with the rest. I will look again in a bit after I give my brain some food. lol. Hopefully then I will be able to understand it better.

later

Ty
 
Upvote 0
You are welcome.

With one of the formula cells selected, click the Formula tab and then click Evaluate Formula.

Each subsequent click on Evaluate will show how Excel is evaluating the underlined element of the formula.

You may need to use the scroll bars to see all of it but it should aid your understanding.

You could change the 106 top of the range to say 35 just in the one formula whilst you evaluate it as that will make the evaluation somewhat clearer.
 
Upvote 0

Forum statistics

Threads
1,214,823
Messages
6,121,779
Members
449,049
Latest member
greyangel23

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