One of the purpose of the database I am building is to organize the organisms found in each sample. Every time a new sample comes in it gets analyzed for several components: chemistry, organism species, etc. There are 56 organism species that are looked for in each sample. At the moment there are 294 samples and I am in the process of trying to construct a query to perform the following calculation for each sample:

S = the number of species in a sample
ni = the number of individuals in species i of a sample
n = total number of individuals in a sample (I already have a query calculating the total individuals per sample, 'Total_Sample')
Not all species are found in every sample, thus having a value of 0 on the original table.
My original table is a larger version of something like this:
Code:
Sample Beetle Fly Moth Spiders
1 4.20 2.30 0.01 1.25
2 2.30 2.00 0.00 3.00
3 3.10 1.60 1.03 2.73
How should I approach this?