In a recent question – Does sneak attack work against an invisible enemy? – it was pointed out that you couldn't Sneak Attack an invisible opponent because the rules specifically state that you cannot use Sneak Attack if you have disadvantage on the attack roll. However, it would not be impossible for the rogue to also have advantage on the attack, by virtue of being hidden or invisible himself.
In this context, where a character has both advantage and disadvantage on a single attack/check, the rules mention that the roll is resolved normally: you roll a single d20 and that's it. Does that mean that you are no longer considered advantaged/disadvantaged?
If so, and assuming the presence of an ally within 5 feet of the invisible enemy, it could mean that an invisible rogue could sneak attack an invisible opponent while a visible rogue couldn't. Is that correct? Or are you, in fact, still considered both advantaged and disadvantaged, and thus can't perform a Sneak Attack?
Precision: Sneak Attack is the use case that triggered the question. That being said, there are probably other things that require advantage/disadvantage to be activated, so answers should focus on the relationship between advantage and disadvantage, and not on Sneak Attack necessarily.
Best Answer
Yes, advantage would negate disadvantage for purposes of Sneak Attack.
According to the rules on advantage and disadvantage (PHB 173, emphasis mine):
So, for example, if you (the rogue) have both advantage and disadvantage on an attack roll against an enemy while your ally is within 5 feet of the target, you could make a Sneak Attack because you are treated as if you don't have disadvantage when making the roll. This complies with the requirements for Sneak Attack (PHB 96, emphasis mine):
However, if the ally were absent in that situation, you could not make a Sneak Attack because you are treated as if you don't have advantage when making the roll.
The same rationale would apply for features other than Sneak Attack that depend on either advantage or disadvantage on any attack roll, ability check, or saving throw. When any such roll is made with both advantage and disadvantage, the roll is made as if it actually has neither advantage nor disadvantage. In this case, no feature which requires advantage or disadvantage would be activated, and no feature which forbids advantage or disadvantage would be precluded.