How to calculate
Divide each species count by the total to get its fraction. Multiply each fraction by its natural logarithm, sum the products, and negate. Divide H by the natural log of observed species richness for evenness.
Worked example
Use Species name and count per row Oak, 50 / Pine, 50. The result is ≈ 0.6931471805599 nats.
Input and result notes
Zero counts contribute zero and do not count as observed species. Effective species equals e raised to the Shannon index. Evenness is undefined for a single observed species.
USGS Shannon diversity and evenness methodology