In this article, we will cover 2 simple methods to group radio buttons in Excel.
Suppose we have the following dataset of a Company’s monthly Sales of Air conditioners, Refrigerators, and Televisions.
Let’s create and group some radio buttons from this data.
Method 1 – Using Form Controls to Create and Group Radio Buttons
Using the form controls from the “Developer” tab, we can easily create and group radio buttons.
Step 1:
We’ll start by adding a radio button to our worksheet.
- Go to the “Developer” tab, click “Insert“, and select the “Radio Button” icon.
- Select a cell and draw the button.
- With the button selected, press Ctrl+D to make multiple buttons.
- Position them, and our multiple radio buttons are created.
Let’s group these buttons.
Read More: Radio Button in Excel Without Macro (Insert, Copy, Group & Delete)
Step 2:
- Go to the “Developer” tab, click on “Insert” and then the “Group” icon.
- Draw a border outside the buttons to group them.
- Select a button and right-click on it.
- From the options, click “Edit Text”.
- Enter “Jan” for the first button.
- Name all the buttons in the group in the same way.
- Using the process above, create another group of radio buttons like in the image below.
Step 3:
Now we links cells for each group of radio buttons.
- Select a button, right-click on it, and click “Format Control” from the options.
- In the “Format Controls” window that opens, choose a cell to link with the button.
- Click OK to continue.
We have successfully linked a cell (F13) with the grouped radio button.
To check that the button works correctly:
- Click on another button and it will show the number “3”, as the radio button is in the 3rd position.
- In the same way, link another cell (H13) with the other group of radio buttons.
Read More: How to Insert Excel VBA Radio Button Input Box
Step 4:
Finally, we will link these groups of options buttons with our dataset.
- Select a cell (B13) to return the month’s name when we press the corresponding radio button from the group.
- Enter the following formula:
=INDEX($B$5:$B$10,$F$13)
The INDEX function returns a value or reference from the given table. Here, $B$5:$B$10 is the array and the row number is $F$13, which will provide a month name according to the cell reference value.
- Press Enter and the month name will be returned.
To check whether the formula is working properly or not:
- Click any radio button and observe the changes.
Now, we will collect the sales value from the dataset by pressing the radio button from the other group.
- Select a cell (C13) and enter the following formula:
=INDEX($C$5:$E$10,ROWS($C$4:E4),$H$13)
- Press Enter to return the desired output.
We have successfully grouped the radio button and used them to gather information from the dataset.
Method 2 – Using ActiveX Controls to Group Radio Buttons in Excel
A somewhat simpler solution to group radio buttons is to use ActiveX Controls.
Step 1:
- Go to the “Developer” tab and click on the “Insert” icon.
- Select “Radio or Option Button” from the “ActiveX Controls” list.
- Like for the previous method, draw the button in your chosen location in the worksheet.
- With the button selected, press Ctrl+D to create multiple buttons.
- Place the buttons under the “Month” heading to group them.
- In the same fashion, create more buttons under the “Sales of Products” heading.
Step 2:
Now we edit and group these radio buttons.
- Select a button, right-click on it, and from the options press “Edit”.
- Enter “January”.
- In the same way, edit all the button names.
- To group those, right-click on a button and select the “Properties” option.
- Set the “GroupName” property to “A”.
- Similarly, for all the month’s buttons, change the group name to “A” to place the button in the same group.
- Group the other buttons by using the “Properties” option in the same way.
- Set the “GroupName” for the other buttons group to “B”.
We have successfully grouped radio buttons in Excel.
Things to Remember
- If you don’t see the “Developer” tab on the top ribbon, go to File > Options > Customized Ribbon and checkmark the “Developer” option to enable it.
Download Practice Workbook
Related Articles
- How to Add Option Button in Excel
- How to Set Option Button Value in Excel VBA
- How to Create & Apply Option Button Click Event in Excel VBA