This question already has an answer here:
I have problems fully understanding the concept of work, so please forgive me if this is simple. If I take a box of mass $ m $, and lift it a distance $ d $ vertically, why is the work I have done equal to $ gmd $, where $ g $ is the force gravity exerts on the box? I understand that work is equal to force times distance--so I'm not asking about the definition of work--but if I exert an upward force equal in magnitude to gravity's, won't the box remain motionless, i.e., net zero force, in which case the velocity is constant, and displacement and work done will be equal to zero?
Edit: To be clear, what I'm asking is not a duplicate of "Why does holding something up cost energy while no work is being done?", because I'm not asking about work done on an object with zero displacement, nor is it a duplicate of "What exactly is F in W=∫baFdx?", because I'm not asking about the distinction between the work done by an individual force and net force.