The efficiency, as it is commonly used, is an efficiency based on the laboratory extract of the grain. Meaning how much of the maximum extract did you get out of the grain. Most grains have a laboratory extract of 80 - 82%. This means that 80 - 82% of the grains weight can be converted and extracted by mashing.
I like to calculate the efficiency this way (note the usefulness of metric and the Plato scale
Eff = 100% * actual extract weight / maximum extract weight
actual extract weight = Volume * SG * Plato/100%
maximum extract weight = grain weight * lab extract/100%
Example: you used 4 kg of grain to make 20l of a 12Plato wort (1.048 SG) assuming a lab extract of 80%:
actual extract weight = 20 l * 1.048 * 12 Plato / 100% = 2.52kg
max extract = 4kg * 80%/100% = 3.2kg
Efficiency = 2.52 kg / 3.2 kg *100% = 78.7%
There are ways to do this with lb and gal as well. They involve knowing the gravity potential of the grain. The latter is basically another expression of the laboratory extract.