Forum Discussion

gcjager's avatar
gcjager
Copper Contributor
Mar 03, 2022

If value in cell C is duplicate change value in cell B

Hey,

 

Was hoping someone could help me with this issue:

 

Equipment33Parent Bundle ID: 1747374
Equipment33Parent Bundle ID: 1747374
Charts33Parent Bundle ID: 1747374

 

Basically the report I'm running is showing each activity as having taken 33 minutes but the reality is that is how long it took the entirety of the bundle. I'm hoping you guys can help me find a way to make it so that if cell C has a duplicate (ie: part of the same bundle) then the values in B2 and B3 would change to 0 to reflect it taking 33 minutes to complete all three tasks.

2 Replies

  • mathetes's avatar
    mathetes
    Gold Contributor

    gcjager 

     

    Here's a simple way to do it, a way that does rely on adding a column. The formula compares each row in column B with the next, as well as each row in column D with the next....when both are the same, it returns a 0, otherwise, the original value.  See the attached spreadsheet for a working copy.

    =IF(AND(B2=B3,D2=D3),0,B2)

    A macro/VBA routine might be able to do this task without the additional column; I prefer an approach like the one I've shown because it retains your original data just in case there's any question.

Resources