The Lifshits-Krein spectral shift function and spectral flow are classical and well-established notions of mathematical analysis. Nevertheless, for many years these theories were developed independently. This book gives a unified exposition of the theory of spectral flow and the spectral shift function in semifinite von Neumann algebras, as well as many other topics necessary for such an exposition. These topics include the Brown measure, the Fuglede-Kadison determinant, double and multiple operator integrals, spectral averaging and Breuer''s theory of relatively Fredholm operators. There is also a chapter devoted to semifinite Dixmier trace. This book will be of interest to specialists in functional analysis, operator theory, operator algebras and mathematical physics.