Assembling or dismantling drillstring sections during tripping operations results in a periodically accelerated or decelerated motion of the drillstring in the borehole. While running in or pulling out of hole the drillstring induces a flow of displaced fluid and a pressure change in the borehole. These pressure changes can be divided into two components: First, the "steady" pressure change associated with the mud viscous friction; and second, the pressure fluctuations caused by induced acceleration of the drilling fluid. Pressure surges are especially dangerous for the uncased well sections and at the bottom of the well, because they can damage and destroy the wellbore. The accurate prediction of pressure fluctuations is significant for wells where the pressure must be maintained within a narrow range to enable safe drilling and completion of the well. Sudden pressure changes in such wells may lead to the so-called water-hammer effect that can be observed in wells when pump operation modes change or when the string is accelerated. A large-scale water-hammer effect may damage the uncased section of a well, leading to fractures or formation fluid inflow. The objective of this paper is to estimate the magnitude of the pressure surges caused by accelerated movement of the drillstring. A mathematical model was formulated to describe the unsteady behavior of flow rate and pressure change along the well. The model involves a one-dimensional system of equations, which are a modification of the equations for hydraulic shocks in the annulus, and the cylindrical part of a well. When frictional losses are neglected, it is possible to derive an exact analytical solution of the problem. This analytical solution was used to estimate the maximum and minimum pressure in the borehole. When combined with the methods for frictional pressure losses, the suggested method can predict the pressure change in a wellbore while tripping. Newtonian and power law fluids were considered for the parameter study.