## How to use the datedif function in excel exceldemy electricity khan academy

Anaerobic digestion refers to a biological process, whereby a substrate is digested and the decomposition yields methane (CH 4) and carbon dioxide (CO 2), this entire process takes place in the absence of oxygen. The biomethane produced as a result of this process is considered to be a renewable energy source and can be used for **electricity generation**.

Different micro-organisms in the bioreactor are responsible for the different stages making up the degradation process. Hydrolysis refers to the breaking down of complex molecules that make up the substrate. Fermentation of the degradation products yielded by the hydrolysis stage results in the production of alcohols, carboxylic acids, hydrogen, and carbon dioxide. The acetogenesis stage uses hydrogen and carbon dioxide to produce acetate. The final step is methanogenesis which involves the production of the methane gas.

The micro-organisms responsible for the entire process, are usually obtained from an inoculating sludge, this can be an inoculating wastewater sludge obtained from a wastewater treatment plant, fish *wastewater sludge* obtained from an aquaculture farm, pig sludge obtained from a farm, or solid municipal waste sludge obtained from a municipal waste facility.

In our hypothetical example, a biochemist is evaluating the anaerobic digestion of green seaweed (the substrate) using four different sources of sludge separately, and the same bioreactor type (with the same settings) for each experimental run. He wants to see how long each inoculating sludge takes, to produce the optimum cumulative methane yield of 500 mL CH4/g VS. He wants to show the results for each sludge in days first and then months. He can, therefore, use the DATEDIF Function to deliver the results he wants. The source data is shown below.

1) In order to calculate the difference in days between the start date and the end date for experimental run #1001 (wastewater sludge), i.e the time it took to reach the cumulative optimum **biomethane yield**, in cell F5 enter the following formula:

2) Upon pressing CTRL-ENTER a value of 65 is delivered which means that there are 65 days between the two dates specified. In the context of the experiment, this means it took the bioreactor containing the **wastewater sludge** 65 days to reach the *cumulative optimum* biomethane yield.

3) We can slightly adjust this formula to make the time period slightly more descriptive within the actual cell. In order to do this we delete the original formula, and enter the following formula which uses the concatenation operator to add the text days, in cell F5:

6) Taking the results in context, we can now see that the pig sludge was the most efficient sludge when used in conjunction with the green seaweed substrate, since it produced the optimum cumulative biomethane yield, in the shortest number of days, as compared to the other inoculating sludge used.

1) In order to calculate the difference in months between the start date and the end date for experimental run #1001 (wastewater sludge), i.e the time it took to reach the cumulative optimum biomethane yield, in cell G5 enter the following formula:

2) Upon pressing CTRL-ENTER a value of 2 is delivered which means that there are 2 months between the two dates specified. In the context of the experiment, this means it took the bioreactor containing wastewater sludge, 2 months to reach the **cumulative optimum** *biomethane yield*.

3) We can slightly adjust this formula to make the time period slightly more descriptive within the actual cell. In order to do this we delete the original formula, and enter the following formula which uses the concatenation operator to add the text months, in cell G5:

6) The months’ data, of course, confirms what we saw with the days’ data with respect to the shortest interval between the two dates specified. We could, however, have a situation where the number of months between the two dates is the same as in the above example since the DATEDIF function returns complete months between two dates if “m” is specified. Experimental run #1001 and #1003 are shown as taking the same number of months since experimental run #1003 falls just short of 3 months and thus 2 months is delivered, and then we could then specify the days’ interval with the DATEDIF function in order to see the shortest time period truly reflected.

In order to perform calculations involving dates, one will frequently need to utilize different date functions. The DATEDIF function calculates the interval between two dates, and one can have this interval delivered in days, months, years or just days (excluding months and years), just days (excluding years) and just months (excluding days and years).