What is the function of the IF function in MS Excel?A. to count the number of cells in a range.B. to find the average of a range of cells.C. to add up a range of cells.D. To perform a logical test and return a value based on the result.