Forum Discussion

and_rogynous's avatar
and_rogynous
Copper Contributor
Apr 26, 2023

If Statement, But Only Wanting Result If Not Already Shown Above in Table

I have a few tables pulling information about boat parts.

The table I'm currently working in has columns for order number [ON], boat number [B], customer part number [CPN], mark [M], our part number [PN], mold number [MN], and whether a piece is new [N]. Order number, boat number, and customer part number are filled out manually; the rest pull from other tables in the document.

The other relevant table is called OPN, which is the first order number in which our part number appears. The columns are order number [ON], customer part number [CPN], mark [M], and our part number [PN].

The "New" column has the following formula:

=IF(AND(COUNTIF(OPN[ON],[@ON])>0,COUNTIF(OPN[CPN],[@CPN])>0,"X","")

Currently, the cells remain blank unless the order number and our part number both match in the second table. However, there are a few instances where the same order number is on more than one table line (when one order has parts for multiple boats), and this leaves me with a predicament: all lines with that order number and our part number have an X in that column, instead of just one (which in these cases should be the lowest boat number).

How do I fix the formula?

Resources