Dimensional analysis is useful when you want to convert between compositions of units. A good example is comparing the price of petrol where different units are being used. If you know the conversion rate between litres and gallons, and the conversion rate between USD and GBP, then you can figure out the conversion rate between USD/gal and GBP/L:

  USD/gal * GBP/USD * gal/L = GBP/L
  1.24 USD = 1 GBP
  1 gal = 3.78541 L
  GBP/USD = 1.24
  gal/L = 3.78541
  USD/gal * 1.24 * 3.78541 = GBP/L
  USD/gal * 4.6939084 = GBP/L
  $4.6939084/gal = £1/L

Agreed, it's super useful to write out all the units and check that they cancel out properly.

I usually write out the Witt I want to convert, complete with units, and successively multiply by dimensionless conversion factors which equal 1.

That is to convert 45 MPG to "km/l" I'd write out:

45 (mile / UK gallon) * (1 UK gallon / 4.55 l) * (1.6 km / 1 mile)

The expression (1.6 km / 1 mile) is dimensionless and equal to 1 (it's a length divided by an equal length).

Cancelling the units gives (45 / 4.55 * 1.6) km/l

I use 'ruby-units' with ruby's 'irb' in order to do complex unit calculations. It's an excellent library and with some helpers one can write:

    (U('45 mi') / U('1.20095 gal')) >> 'km/l'
It doesn't come with an imperial gallon, but it could be added. It's also fun to do stuff like:

    (U('3.99e33 ergs/s') / (4 * Math::PI * U('1 AU')**2)) >> 'W/m^2'
To get the potential available solar energy output at earth's average orbital distance from the sun usefully expressed as Watts per Square Meter.

Anyways, what I really got from unit analysis was a more useful and fundamental understanding of electronics. Getting an intuition for how Tesla's relate to Weber's relate to Volts and Ohms and how the Coloumb relates to the Ampere and Siemen and how they all combine into Henry's and Farad's both to ultimately lead you right into Joule's and Watt's. I really wish I was taught the material that way.

Similar library for Julia is Unitful.jl (https://github.com/PainterQubits/Unitful.jl).