CompTIA Data+ (DA0-001) — Question 306
Which of the following formulas correctly illustrates an IF statement?
Answer options
- A. =IF(A1=2,"no","hat")
- B. =IF(A1=2,"no","hat")END
- C. =IF(A1,"no","hat")
- D. =IF(A1=2,no,hat)
Correct answer: A
Explanation
The correct answer is A because it follows the proper syntax for an IF statement in Excel, which requires a logical test, a value if true, and a value if false. Option B incorrectly appends 'END', while option C lacks the necessary comparison operator for a true/false evaluation, and option D does not use quotes for the text values, which is required.