Filter formula - reference a particular column in a named table

Trille

New Member
Joined
Apr 26, 2010
Messages
27
Hi all!

I'm having some issues with a filter formula... Basically, I have a named table from which I want to return multiple results based on another cell's value (C7 in this particular case). This is the current formula which, in a perfect world, would return results from the table's column B, based on the values in column A (criteria found in C7 as seen in the formula below):

=TRANSPOSE(FILTER(INDEX(Table;;2);INDEX(Table;;)=C7;""))

This formula returns the #REF! error. When I remove the "2" in the first index, the formula returns values but from the first column. I'm not quite sure if I should add something to the second part of the formula, i.e. the "include" part?

Any help would be much appreciated!

/Trille
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Going by the emoticon that is in the formula, I'd take a guess that you haven't specified a column number in the second index range.

Using the table and column name for the filter range and criteria would be a better way though.
 
Upvote 0
Hi Jason!

Sorry for that.. should've hit "preview"... So the easiest way would basically be to define the dynamic range for each column instead of the idea above?
 
Upvote 0
The smiley face thing catches everyone out, you don't expect it to crop up in the middle of a formula, but seeing it tells me that there is no number after the second semicolon in the second INDEX function. Adding a 1 to the formula at this point should fix the error.
Excel Formula:
=TRANSPOSE(FILTER(INDEX(Table;;2);INDEX(Table;;1)=C7;""))

For the alternative method, when you said
I have a named table
I assumed that you meant one created by going to Insert > Table on the excel ribbon.

If that is correct, then something like
Excel Formula:
=TRANSPOSE(FILTER(Table1[[Column2]:[Column2]];Table1[[Column1]:[Column1]]=C7;""))
should do it if you change the names used to match your actual table.
 
Upvote 0
Thanks a lot for your help, Jason! I actually tried the first formula (with the added "1"), but kept getting an error... I have no idea why..

To solve the problem I just added the dynamic portion directly in the formula with OFFSET/COUNTA... It's not the prettiest, but it works.

Again, I really appreciate your time and effort!
 
Upvote 0
It's not the prettiest, but it works
as long as there are no empty rows.

Both methods that I suggested work perfectly well when entered correctly. With the added 1 in the original formula, you wouldn't get a #REF! error, but without knowing the error that you got instead of #REF! there is no way of knowing what is wrong with it.
 
Upvote 0

Forum statistics

Threads
1,214,566
Messages
6,120,266
Members
448,953
Latest member
Dutchie_1

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