work around for array formula in numbers

I have an excel array formula that I am trying to replicate in numbers.

I have a table of data that contains various revenue types.

I want to return only those items that are marked as "membership" revenue on a new sheet


the formula i have is

index(L$2:L$150,small(if(Q$2:Q$150="Membership",Row(L$2:L$150)-Row(L$2)+1),Row(L 1)))

when I put this is an array and copy it then it skips the rows that don't relate to membership.


In numbers the formula works in the first cell but I can't copy it so that it returns only the membership data.

Posted on Jul 6, 2014 5:02 AM

Reply
6 replies

Jan 24, 2017 12:36 AM in response to SGIII

I'm curious about the ROW()-2 part. Why are you subtracting 2? In my sheet I have to subtract 1 to make it work and I'm trying to understand the inner workings. I get how the index is made using =B2&COUNTIF(B$1:B2,B2), but I don't get how it's extracted using =INDEX(Table 1::A,MATCH($A$1&ROW()−2,Table 1::$D,0))


Any help understanding this concept would be greatly appreciated!

Jan 24, 2017 3:40 AM in response to ori-guy

The ROW()-2 takes the row number the formula is on (row 3 for the first body row in my example) and subtracts 2. The idea is to adjust for the number of Header Rows. Thus the formula in A3 of my example will construct the string "membersip1" and use MATCH to look up the row number for that in the Index column and feed that row number to INDEX to retrieve the corresponding value in another column. If you have only one Header Row in your table then you would subtract 1 instead of 2.


It's a little tricky the first time (because you have to remember to think about the Header Rows) but the underlying approach is simpler than it looks.


SG

Jul 6, 2014 8:45 AM in response to W He

Given this:


User uploaded file


How about a filter?


User uploaded file


Giving this:


User uploaded file

You can then copy the body cells of the filtered table into another existing table, which you can sort, etc.


Or, if you want have the second table automatically refresh (but don't care about sorting it) you could do something like this.


Add an index column (that you can later hide if you want):


User uploaded file


The formula in D2, copied down, is: =B2&COUNTIF(B$1:B2,B2)



And then use a formula like this to extract the values into the second table:


User uploaded file



The formula in A3, copied right and down, is:


=INDEX(Table 1::A,MATCH($A$1&ROW()−2,Table 1::$D,0))


If you want, you can wrap it in IFERROR to suppress the red warning triangles in the lower rows:


=IFERROR(INDEX(Table 1::A,MATCH($A$1&ROW()−2,Table 1::$D,0)),"")


SG

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

work around for array formula in numbers

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.