Filter OpenOffice Calc rows by matching if a cell in one column exists in another column with a certain value

1

1

Have a question I cant seem to figure out using the filter.

Column A has 1400 rows with 800 additional rows that are duplicates (so 2200 total rows).

Column B has inventory amount for only the last 800 rows of Column A.

I want to filter my data so I only select rows where there is a duplicate value for Column A and my inventory amount in Column B is greater than 0 (i.e. one of those last 800 rows)

chris

Posted 2014-07-21T16:59:08.800

Reputation: 15

Dunno about Calc, but with Excel you could use the following in a "helper column" (example formula for row 1): =AND(COUNTIF(A:A,A1)>1,B1>0). Then, filter the sheet to only show rows where that column's value is TRUE. – Iszi – 2014-07-29T21:26:16.430

Answers

0

Instead of using a array formula, you could use the COUNTIF() function to check for duplicates. Assuming this sample data:

enter image description here

You can add a flag in Column C indicating duplicates in Col. A using this formula in C2, and copying it down:

=(COUNTIF($A$2:$A$13, A2)>1)

This results in:

enter image description here

Now, you can add a second "flag column", combining the boolean value of col C with a check for B>0:

=AND(C2,B2>0)

Now, we have:

enter image description here

Of course, you could combine both formulae - the result (again for row 2) may look like:

=AND((COUNTIF($A$2:$A$13,A2)>1),B2>0)

As result, you have an additional column with a TRUE flag for all rows that are duplicates and have an amount > 0. Now, you can apply an AutoFilter (Menu "Date" -> "Filter" -> "AutoFilter") and filter for rows with that TRUE flag:

enter image description here

(tested with LO Calc - should work the same way using OOo Calc).

tohuwawohu

Posted 2014-07-21T16:59:08.800

Reputation: 8 627

0

I suggest you add one column and then use Autofilter after that.

The added column should then contain "flags" for duplicates, if the table starts at line 2 the formula will be:

=SUM(IF($A$2:$A$9999=A2,1,0))
edit: Realized that by adding >1 at the end here you will get "TRUE" / "FALSE" flags instead. It is up to you.

and that needs to be entered in the cell with CTRL+SHIFT+ENTER
This will make it read with { and } at the ends as you VIEW the formula in the formula bar.

These cells will contain the COUNT of that value in the column, so: duplicates are >1

Copy the formula to the other lines... then use the Autofilter features for the remainder of the filtering.


NOTE: LibreOffice requires a change to the cell contents for re-entering it, add a space at the end

Hannu

Posted 2014-07-21T16:59:08.800

Reputation: 4 950

I get Err:522 when I try that. I don't see how that would help me. My duplicates are not in a separate column, they are in the SAME column. – chris – 2014-07-21T18:33:22.683

I had ; in there, changed to , now did that help? – Hannu – 2014-07-21T18:37:40.740

... you didn't have a ';' in your original suggestion?!? I can't even use =(a2=c2) – chris – 2014-07-21T18:43:40.127

the second suggestion =IF((A2=C2),"DUPE","-") gives Err:508 – chris – 2014-07-21T18:44:25.473

You have some strange Excel then. Have a look above again. – Hannu – 2014-07-21T18:47:51.523

I'm doing this in OpenOffice Calc – chris – 2014-07-21T18:48:28.947

I'm writing stuff that works in both Excel and LibreOffice Calc (where I try it out as I type). As I have not tried OO-Calc I cannot comment on it. May be you have an older version? – Hannu – 2014-07-21T18:51:02.613

Just downloaded libreoffice . I have a '1' value for everything. – chris – 2014-07-21T19:09:41.683

Hmm... look for the curly braces, do you have them? Did you enter the formula with CTRL+SHIFT+ENTER ? – Hannu – 2014-07-21T19:11:03.820

how can i enter it into a cell using ctrl+enter+shift? i cant press that and ctrl+v at the same time. I'm lost. – chris – 2014-07-21T20:31:30.183

CTRL-V first, type/change if required, then CTRL+SHIFT+ENTER. – Hannu – 2014-07-22T18:45:08.170