If duplicate value then return just one value and put zero in the other one

Anonymous
2018-01-01T19:15:21+00:00

Hi everyone,

I'm using an if function to try to return one value and put zeros in the duplicated ones. However, I can't to this second step.

See the example:

As you can see on the yellow rows I have to repeated costs (3500) and 2 repeated capacity tons value (6). So I want to have only ONE cost (green one) and have a zero on the red cell instead of the 3500, IF the capacity tons is less or equal to 18 and times repeated is more than 2.

I didnt add the columns to the picture, so see them as A,B,C and rows 1,2,3 etc.

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes
Answer accepted by question author
  1. Anonymous
    2018-01-01T20:03:54+00:00

    I'm embarrassed. Here is the next correction:

    =IF(NOT(AND(COUNTIF($B$2:$B2, B2)>1,D2<=18)),A2,0)

    4 people found this answer helpful.
    0 comments No comments

6 additional answers

Sort by: Most helpful
  1. Anonymous
    2018-01-01T20:03:01+00:00

    I'm not doing well with pasting - use this one instead:

    =IF(NOT(AND(COUNTIF($B$2:$B2, B2)>1,D2<18)),A2,0)

    0 comments No comments
  2. Anonymous
    2018-01-01T20:15:51+00:00

    Yessssss. Amazing Jason!!! What a great way to start 2018 learning a new excel function.

    Thank you very much and have a great new year!!

    Diego.

    0 comments No comments