Home > Back-end >  List all rows that do not have 2 matching unique ids
List all rows that do not have 2 matching unique ids

Time:08-30

I am trying to keep track of an Add Log and Subtract Log for a list of items and create a list of items still in stock based of of what items have been removed using the Subtract Log. I want the Add/Subtract Log Results to show all items that do not have a matching unique ID (ColA) in the Subtract Log unless a item was returned and added a second, third, forth, etc. Time to the Add Log. If the item is then added to the Subtract Log again it should be removed from the Add/Subtract Log Results sheet

The current formula that I am using is

=UNIQUE({QUERY(QUERY({UNIQUE('Add Log'!$A$2:$D); UNIQUE('Subtract Log'!$A$3:$D)}, "SELECT Col1, Col2, Col3, Col4, COUNT(Col1) WHERE Col1 <> '' AND Col2 <> '' AND Col3 <> '' AND Col4 <> '' GROUP BY Col1, Col2, Col3, Col4", 0), "SELECT Col1, Col2, Col3, Col4 WHERE Col5 = 1", 0); QUERY(QUERY('Add Log'!$A$2:$D, "SELECT A, B, C, D, COUNT(A) GROUP BY A, B, C, D", 0), "SELECT Col1, Col2, Col3, Col4 WHERE Col5 > 1", 0)})

For some reason if I delete the info in row 11 the formula breaks as well but it seems like if I delete anything else it's fine.

enter image description here

  • Related