Forum Discussion
Removing duplicates
- Oct 15, 2019
Thank you for the clarification. With this I'd use the formula as
=IF( COUNTIF($D$2:$D2,$D3),0, SUMPRODUCT(('N:\Audit Database\2019 Audits\Los Angeles\November 2019\Environmental\Losses\[Environmental Loss Run 10.14.19.xlsx]Sheet1'!$A:$B=D3)*1))and apply to column custom number format as
General;General;"-"??;@to hide zeros.
In your latest sample it's not removing of duplicates for which you remove entire rows based on some criteria. Here you'd like to empty repeating values in first and second columns keeping the rest untouched.
Better to do that with formulas in these first columns. Logic of formula depends on logic of the data structuring - will it be sorted/filtered or not; is it necessary to treat differently zero values and empty cells; shall we empty these values only for sequentially repeating values in 4th column or that doesn't matter. For example, in your sample you empty values for GGG Demolition, Inc. but not for Bairos Recycling Inc, which also is repeating with non-zero values, but not one by one.
For example, in A3 it could be
=IF( (D3=D2)*(A2>0),"", SUMPRODUCT(('N:\Audit Database\2019 Audits\Los Angeles\November 2019\Environmental\Losses\[Environmental Loss Run 10.14.19.xlsx]Sheet1'!$A:$B=D3)*1))
, similar in B3 and we may drag them down.
Perhaps above formulas shall be more complex, but again, it depends logic of data itself.
You raised some good questions: (a) The data does not have to be filtered/sorted; (b) there is no difference between cells with zero values and empty cells. (I removed the repeated (non-zero) values for GGG Demolition under to "To This" data set and left those cells blank/empty, and (c) I overlooked the second/lower $810 entry for Bairos Recycling, which I should have cleared/deleted under the "To This" data group, same as I did with GGG Demolition.
Again, thanks.
- SergeiBaklanOct 16, 2019Diamond Contributor
Michael, you are welcome
- MMcDonalOct 16, 2019Copper Contributor
- SergeiBaklanOct 15, 2019Diamond Contributor
Thank you for the clarification. With this I'd use the formula as
=IF( COUNTIF($D$2:$D2,$D3),0, SUMPRODUCT(('N:\Audit Database\2019 Audits\Los Angeles\November 2019\Environmental\Losses\[Environmental Loss Run 10.14.19.xlsx]Sheet1'!$A:$B=D3)*1))and apply to column custom number format as
General;General;"-"??;@to hide zeros.