Axial field of a finite, straight, thin shell solenoid 
This formula uses the formula for the field due to a current loop, integrated over a range off axial displacements to obtain the magnetic field at any point on the axis of a finite, thin shell solenoid.  
Solenoid in cross section view. 

General Case:  
B
is the magnetic field, in teslas, at any point on the
axis of the solenoid. The direction of the field is
parallel to the solenoid axis. is the permeability constant (1.26x10^{6} H/m) i is the current in the wire, in amperes. N is the total number of turns of wire in the solenoid. l is the length of the solenoid, in meters. r is the radius of the solenoid, in meters. x_{1} and x_{2} are the distances, on axis, from the ends of the solenoid to the magnetic field measurement point, in meters. 

Special Case: x_{1}=(x_{2})  
The magnetic field measurement point is at the center of the solenoid.  