Forum Discussion

GEnglish1230's avatar
GEnglish1230
Copper Contributor
Jul 03, 2023

Excel

I need your assistance! 

What steps are required to write this conditional formatting function scenario?

I have 20 multiple-choice questions; each question has four choices (A, B, C, or D). I have an answer key. For each question, I need the function to check each choice (A, B, C or D) against the answer key and put an asterisk (*) in front of the correct answer choice.

 

Thank you in advance!

1 Reply

  • NikolinoDE's avatar
    NikolinoDE
    Gold Contributor

    GEnglish1230 

    It is possible to achieve the desired result using formulas or functions in Excel.

    Here is an approach using a formula:

    1. Assuming the multiple-choice questions and choices are in columns A to E (Question in column A, Choices in columns B to E), and the answer key is in column F.
    2. Select the range of cells where you want the asterisks to appear (e.g., select the cells in column B to E for the first question).
    3. Go to the "Home" tab in the Excel ribbon.
    4. Click on "Conditional Formatting" in the "Styles" group, and then select "New Rule" from the drop-down menu.
    5. In the "New Formatting Rule" dialog box, select the option "Use a formula to determine which cells to format."
    6. In the "Format values where this formula is true" field, enter the following formula:

    =$B1=$F1

    This formula compares each choice (cell in column B to E) with the corresponding answer key (cell in column F) for the current question.

    1. Click on the "Format" button to specify the formatting you want to apply to the correct answer choice. In this case, you want to put an asterisk (*) in front of the correct answer choice.
    2. In the "Format Cells" dialog box, go to the "Number" tab, select the "Custom" category, and enter the following format in the "Type" field:

    "* "@

    1. Click "OK" to close the "Format Cells" dialog box.
    2. Click "OK" again to close the "New Formatting Rule" dialog box.

    The conditional formatting will be applied to the selected range of cells, highlighting the correct answer choices with an asterisk (*) in front of them.

    You can repeat these steps for each question, adjusting the cell references as needed.

    The text and steps were created with the help of AI.

     

    Hope this will help you.

Resources