numbers formula problem

I have the following numbers, 20 in total. Numbers are from 0-9.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

3 7 8 1 2 6 6 7 3 1 0 7 0 1 2 2 1 6 8 2


i have another row where I want to put all the numbers that exist in the row 2. numbers that do not appear in that row should not appear in my other row.

But i just want to display the numbers once. The result would be like this:


0 1 2 3 6 7 8


Each number in a different cell.


4,5 and 9 do not appear.


I Hope you could understand my problem. I could post a screenshot, but this forum is buggy.


many thanks,

iMac (27-inch Mid 2011), OS X Mavericks (10.9.5), Pages 5.2.2

Posted on Oct 16, 2014 10:53 AM

Reply
18 replies
Sort By: 

Oct 16, 2014 11:07 AM in response to Rubberdonkey

Here is a way:

User uploaded file

add a new row for the formula that "filters" for the first occurrence:

B3=IF(COUNTIF($A$3:A3, B2)=0, B2, "")


this is shorthand for... select cell B3 then type (or copy and paste from here) the formula:

=IF(COUNTIF($A$3:A3, B2)=0, B2, "")


select cell B3, copy

select cells B3 thru U3, paste

Reply

Oct 17, 2014 4:50 AM in response to Wayne Contello

I post a screenhsot, maybe it works. I tried you version, but couldn't get it working.


User uploaded file

In the row "Durchmesser", I want to have all the numbers that appear in the blue cells. But only once. You can see the expected result in the row "Druchmesser". And I want them sorted, but this is no problem.

Reply

Oct 17, 2014 4:14 PM in response to Rubberdonkey

As Wayne suggest, for each row of data you are going to need a helper row using IF COUNTIF. Then to retrieve sorted data, you can use the SMALL (sort ascending) or LARGE (sort descending) function. For example:



1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

DATA

16

15

17

16

19

17

16

16

16

18

15

14

14

14

15

Helper row

16

15

17


19





18


14




Result

14

15

16

17

18

19












In row 3 I have this formula, B3, copied right:

=IF(COUNTIF($B2:B2,B2)=1,B2,"")


The above is the same as Wayne's approach.


Then in row 4 I have this formula in,B4, copied right:

=IFERROR(SMALL(3:3,B1),"")


The left column is defined as a Header Column.


Your localization may require you to substitute ; where I show , in formulas.


SG

Reply

Oct 18, 2014 1:45 AM in response to SGIII

Hello SGIII:


This worked so far. The problem is, that I have two rows (the two blue ones) with data. The last step with IFERROR requires me to check both rows. If in the second blue row is a number, which does not appear in the first one, it won't be recognized. How do I do this?

I don't know the syntax for combining two separate rows into one argument.


IFERROR(SMALL(3:3 [and here has to be the row 5:5 also], B1),"")


How do I replace this with something numbers understand? If the two rows were next to each other, it wouldn't be a problem, because I could select them with the mouse. I just don't know how two select them, when they are apart.

Reply

Oct 18, 2014 11:56 AM in response to Rubberdonkey

Splitting a series of data into more than one column or row complicates life. But if it is important to do that (perhaps for ease of data entry) then here is one way to accomplish what I understand you are looking for:


This is the sample data table (I reduced the number of columns for demonstration purposes):



1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

DATA 1

16

15

17

16

19

17

16

16

16

18

15

14

14

14

15


16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

DATA 2

11

9

12

10

12

14

13

11

12

14

15

13

14

15

18



Then you can create a "Helper Table" that looks like this (in practice it will have many more rows):


Value

Distinct

Ranked

DATA 1

DATA 1

9

16

16

10

15

15

11

17

17

12

16


13

19

19

14

17


15



The formula in A2 of the Helper Table, copied down as far as you can go until you get a red triangle range error is, is:


=INDEX(UNION.RANGES(FALSE,Data::$A$1,Data::$2,Data::$4),1,ROW())


(The $2 and $4 appear in this pasted formula means to anchor to those rows. You get that by clicking the row number to select the row)


The formula in B2, copied down, is:


=IFERROR(IF(COUNTIF(A$1:A2,A2)=1,A2,""),"")


The formula in C2, copied down, is:


=IFERROR(SMALL(B,ROW()−1),"")


(The B here is the column B address token which you get by clicking the column letter to select the column.)


Your summary table would look something like this:


Durchmesser

9

10

11

12

13

14

15

16

17

18

19






























The formula in B2, copied right until you get a blank, is:


=IFERROR(INDEX(Helper Table::$C,COLUMN()),"")



SG

Reply

Oct 18, 2014 11:53 PM in response to SGIII

Ok, I will try that one later, for now, I will use just one data row.


Durchmesser91011121313141516171819


How can I hide the orange (empty) cell? I want the whole table to be dependent from the main table with the data. So, for instance, when you put a "20" in the main table, this table should expand to show "20" in a new column. But if not, how can I hide the cells that are empty? I cannot put the numbers of "Durchmesser" in a column, because the table will have many more rows, which depend on the "durchmesser" row. How can I filter rows?

Reply

Oct 19, 2014 12:53 AM in response to Rubberdonkey

Hi Rubberdonkey,


Just lurking around.


Courtesy of Google Translate

Mit freundlicher Genehmigung von Google Translate


Urliste = original list

Verteilung = distribution

Durchmesser = diameter

Häufigkeit = frequency

Rubberdonkey wrote:


Ok, I will try that one later, for now, I will use just one data row.


Durchmesser 9 10 11 12 13 13 14 15 16 17 18 19


How can I hide the orange (empty) cell? How can I filter rows?


Have you thought of using columns instead of rows? You can filter the table to hide rows with empty cells in the Durchmesser column.


(The lurker walks away).


Regards,

Ian.

Reply

Oct 19, 2014 7:55 AM in response to Rubberdonkey

columns are not an option for me. I just don't understand why you can't filter rows.


That's an interesting question. I don't think any spreadsheet software can filter rows. Neither Numbers nor Excel can. So in situations where filtering is important, you might, as Ian suggests, try to orient your data. If you're running the new Numbers 3.5 under Yosemite, you might experiment with the new Table > Transpose Rows and Columns functionality. Perhaps your data will work better in columns than you think. Sometimes it's hard to visualize how that would look. With the new built-in transpose functionality, it's much easier to give that a try.


SG

Reply

Oct 19, 2014 9:59 AM in response to SGIII

Hi SG,


You are so far ahead of me. Thank you for that tip.

Original table


Fruit

Unit

Cost

Apple

Kilo

$2.50

Banana

Bunch

$1.40

Cherry

Punnett

$1.20


Numbers 3.5 Menu > Table > Transpose Rows and Columns


Fruit

Apple

Banana

Cherry

Unit

Kilo

Bunch

Punnett

Cost

$2.50

$1.40

$1.20


Crikey! Too easy!


Regards,

Ian.


P.S. I hope the salties don't invade. Ian.

Reply

Oct 19, 2014 10:20 AM in response to Yellowbox

Hi Ian,


P.S. I hope the salties don't invade.


No salties spotted yet over here yet. Of course by the time one emerges from the depths it may too late.🙂 So I'm keeping Time Machine revved up, knowing one can never be too careful.


SG

Reply

Oct 19, 2014 10:36 AM in response to Yellowbox

I tried this, but reorganizing the table will kill any filters and sortings you did.


WHY in the world would you write a program that can sort and filter columns but not rows? Is there a specific reason? I mean, a usual table contents more than one column. That does not make any sense. If I am wrong, please tell me.

Reply

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.

numbers formula problem

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