Without getting into complicated formulas, it's simply the sugars extracted divided by the potential maximum extraction. I find it easiest to work in points per pound per gallon. That's PPPG to be correct, though most folks abbreviate it PPG for ease and simplicity.
Reference this table in How To Brew:
http://howtobrew.com/book/section-2/what-is-malted-grain/table-of-typical-malt-yields
Find the closest match to the grain you're using. Just get close, a couple points off won't make a big difference. Multiply the pounds of grain with the 'Max PPG'. That gives you the maximum potential extract of your mash.
Now you need the PPG of your mash. You'll have to measure volume and gravity in SG. Take everything in the SG after the 1. Now multiply by the volume in gallons. Divide that number by the maximum potential extract, then multiply by 100. That's your mash efficiency.
Example:
I mashed 7 lbs of pale malt and 1/2 lb of crystal 120 for my Bitter. That gives a max PPG of (7x38)+(.5x33)=282.5 PPG.
Now after my mash and sparge, but before the boil, I have 6.5 gals of wort at an SG of 1.031. I multiply 31 x 6.5 to get 201.5 PPG actual.
201.5/282.5= 0.713. Multiply by 100 for 71.3% mash efficiency.
If you measure in liters and degrees Plato or Balling then you'll have to convert to gallons and SG for ease of calculation.