You could achieve this using Conditional Formatting and SUMIF formula to achieve this

I've used the following conditional formatting rules (You will need to change this for your ranges)

The conditional formatting is applied to both the cell fill and also the font text colour (to make the True/False be 'invisible')

In cell C6 (a merged range) I have the formula

=SUMIF(3:5,TRUE,3:5)

Where cells in the D range contain the values of the linked cells for the checkboxes (i.e. True, False)and C range is the values you want to sum.

This is a much simpler approach then any VBA solution and personally, I'd remove the formatting of the cells from your vba above and just use the conditional formatting.

If you're looking for a VBA way to initiate this (except for the SUMIF formula) I've updated your below code to add the conditional formatting

Sub Insert_Checkbox_Link_Cell()
    Dim rngCel, myCells As Range
    Dim ChkBx As CheckBox
    Dim cBx As Long

    Set myCells = Selection
    myCells.NumberFormat = ";;;"

    Application.ScreenUpdating = False
    For Each rngCel In myCells
        With rngCel.MergeArea.Cells
            If .Resize(1, 1).Address = rngCel.Address Then
                Set ChkBx = ActiveSheet.CheckBoxes.Add(.Left, .Top, .Width, .Height)
                With ChkBx
                    .Value = xlOff
                    .LinkedCell = rngCel.MergeArea.Cells.Address
                    .Text = ""
                    .Width = 18
                    .Top = rngCel.Top + rngCel.Height / 2 - ChkBx.Height / 2
                    .Left = rngCel.Left + rngCel.Width / 2 - ChkBx.Width / 2
                End With
            End If
        End With
    Next rngCel

    With myCells
        ' Set default value
        .Value2 = False
        ' Add conditional formatting for False value
        With .FormatConditions
            .Add Type:=xlExpression, Formula1:="=" & myCells.Cells(1).Address(False, True) & "=False"
        End With
        With .FormatConditions(.FormatConditions.Count)
            .SetFirstPriority
            With .Interior
                .Pattern = xlSolid
                .PatternColorIndex = xlAutomatic
                .Color = 9868950
                .TintAndShade = 0
                .PatternTintAndShade = 0
            End With
            With .Font
                .Color = -6908266
                .TintAndShade = 0
            End With
        End With
        ' Add conditional formatting for True value
        With .FormatConditions
            .Add Type:=xlExpression, Formula1:="=" & myCells.Cells(1).Address(False, True) & "=True"
        End With
        With .FormatConditions(.FormatConditions.Count)
            .SetFirstPriority
            With .Interior
                .Pattern = xlSolid
                .PatternColorIndex = xlAutomatic
                .Color = 52377
                .TintAndShade = 0
                .PatternTintAndShade = 0
            End With
            With .Font
                .Color = -16724839
                .TintAndShade = 0
            End With
        End With
    End With

    Application.ScreenUpdating = True
End Sub
Answer from Tom on Stack Overflow
🌐
Excel University
excel-university.com › home › blog › sum if checked
Sum if Checked - Excel University
October 1, 2024 - To sum the total amount for the checked items, we’ll use the SUMIFS function. The SUMIFS function allows us to sum values in a range based on a condition. Our condition here is that the checkbox cell must be TRUE (checked).
🌐
ExtendOffice
extendoffice.com › home › office tips › excel tips
How to sum / count checked checkboxes in Excel?
April 17, 2025 - Open your worksheet which you want to count or sum the checked checkboxes, then right click one checkbox, and choose "Format Control", see screenshot: In the "Format Object" dialog box, under the "Control" tab, click to select a blank cell which relative to your selected checkbox as the link ...
🌐
Excel Insider
excelinsider.com › home › our blog › google sheets intermediate tutorials › how to sum values if checkbox is checked in google sheets
How to Sum Values If Checkbox Is Checked in Google Sheets - Excel Insider
August 10, 2025 - ➤ Enter this formula: ... ➧ IF(D2:D8=TRUE, C2:C8, 0) creates an array where each amount is included only if its corresponding Approved checkbox is TRUE; otherwise, it’s zero.
🌐
Reddit
reddit.com › r/excel › how to sum values if checkbox is checked?
r/excel on Reddit: How to Sum values if checkbox is checked?
September 8, 2021 -

Hello!

I am trying to create a tool that would help me to compute custom items set sum. I have a range of items that can be combined to create different product configurations. I would like to be able to check checkboxes near these items and as soon as the checkbox is checked the sum of this item would be added to total cost.

At the moment i put "X" next to the item in cell and in next column use IF to find the value (IF cell A has "X" then return value in cell B, otherwise return 0) and then at the end of this column I sum the values. Thats cumbersome.

I would want to have one cell where value changes as soon as i check or uncheck the checkbox near the item.

🌐
Reddit
reddit.com › r/excel › how do i sum only the cells which are checked?
r/excel on Reddit: How do I sum only the cells which are checked?
October 8, 2024 - I'm working on an order list for a school project, and i'm a huge noob with excel formulas. I was wondering how to add a sum at the bottom of only the cells that are checked on the side? I'm not sure if I'm wording that right but if anyone could help me that would be great!
Top answer
1 of 2
1

You could achieve this using Conditional Formatting and SUMIF formula to achieve this

I've used the following conditional formatting rules (You will need to change this for your ranges)

The conditional formatting is applied to both the cell fill and also the font text colour (to make the True/False be 'invisible')

In cell C6 (a merged range) I have the formula

=SUMIF(3:5,TRUE,3:5)

Where cells in the D range contain the values of the linked cells for the checkboxes (i.e. True, False)and C range is the values you want to sum.

This is a much simpler approach then any VBA solution and personally, I'd remove the formatting of the cells from your vba above and just use the conditional formatting.

If you're looking for a VBA way to initiate this (except for the SUMIF formula) I've updated your below code to add the conditional formatting

Sub Insert_Checkbox_Link_Cell()
    Dim rngCel, myCells As Range
    Dim ChkBx As CheckBox
    Dim cBx As Long

    Set myCells = Selection
    myCells.NumberFormat = ";;;"

    Application.ScreenUpdating = False
    For Each rngCel In myCells
        With rngCel.MergeArea.Cells
            If .Resize(1, 1).Address = rngCel.Address Then
                Set ChkBx = ActiveSheet.CheckBoxes.Add(.Left, .Top, .Width, .Height)
                With ChkBx
                    .Value = xlOff
                    .LinkedCell = rngCel.MergeArea.Cells.Address
                    .Text = ""
                    .Width = 18
                    .Top = rngCel.Top + rngCel.Height / 2 - ChkBx.Height / 2
                    .Left = rngCel.Left + rngCel.Width / 2 - ChkBx.Width / 2
                End With
            End If
        End With
    Next rngCel

    With myCells
        ' Set default value
        .Value2 = False
        ' Add conditional formatting for False value
        With .FormatConditions
            .Add Type:=xlExpression, Formula1:="=" & myCells.Cells(1).Address(False, True) & "=False"
        End With
        With .FormatConditions(.FormatConditions.Count)
            .SetFirstPriority
            With .Interior
                .Pattern = xlSolid
                .PatternColorIndex = xlAutomatic
                .Color = 9868950
                .TintAndShade = 0
                .PatternTintAndShade = 0
            End With
            With .Font
                .Color = -6908266
                .TintAndShade = 0
            End With
        End With
        ' Add conditional formatting for True value
        With .FormatConditions
            .Add Type:=xlExpression, Formula1:="=" & myCells.Cells(1).Address(False, True) & "=True"
        End With
        With .FormatConditions(.FormatConditions.Count)
            .SetFirstPriority
            With .Interior
                .Pattern = xlSolid
                .PatternColorIndex = xlAutomatic
                .Color = 52377
                .TintAndShade = 0
                .PatternTintAndShade = 0
            End With
            With .Font
                .Color = -16724839
                .TintAndShade = 0
            End With
        End With
    End With

    Application.ScreenUpdating = True
End Sub
2 of 2
1

You can give a value (eg: 1 for checked and 0 for unchecked) to the cell where the checkbox is added in your color change function. keep the cell's font color the same as the cell's fill color so that the value will be invisible to naked eyes. then in the total sum section, you can use sumif function.

🌐
Super User
superuser.com › questions › 1805392 › add-value-from-range-to-sum-if-checkbox-is-true
microsoft excel - Add value from range to sum if checkbox is true - Super User
August 22, 2023 - =SUM(IF(R7=TRUE,U5,0),IF(R8=TRUE,U6*D9,0),IF(R9=TRUE,U7*D9,0),IF(R10=TRUE,U8*D7,0),IF(R11=TRUE,U9*D9,0),IF(R12=TRUE,U10*D8*D9,0),IF(R13=TRUE,U11*D9,0),IF(R14=TRUE,U12*D9,0),IF(R15=TRUE,U13*D9,0),IF(R16=TRUE,U14*D9,0),IF(R17=TRUE,U15*D5,0),IF(R18=TRUE,U16*D5,0),IF(R19=TRUE,U17,0),IF(R20=TRUE,U18,0))
🌐
Statology
statology.org › home › google sheets: how to sum if checkbox is checked
Google Sheets: How to Sum If Checkbox is Checked
September 26, 2022 - This tutorial explains how to sum values in Google Sheets if a corresponding checkbox is checked, including an example.
Find elsewhere
🌐
YouTube
youtube.com › shorts › NIo2jARYcJ0
SUMIF based on checkboxes in Excel - YouTube
How to sum values or numbers based on the number of checkboxes checked in Excel?How to make total for the amounts based on checkboxes checked? Excel & VBA di...
Published: July 19, 2023
🌐
YouTube
youtube.com › chester tugwell
Count Checked Checkboxes in Excel | Sum if Checkbox is Checked | Formula to Count Checked Checkboxes - YouTube
Download the featured file here: https://www.bluepecantraining.com/wp-content/uploads/2023/03/Count-checked-checkboxes.zipIn this Microsoft Excel video tutor
Published: March 24, 2023
Views: 56K
🌐
YouTube
youtube.com › watch
Excel Sum if Checked
To learn more, please visit the YouTube Help Center: https://www.youtube.com/help
🌐
Howtoexcelatexcel
howtoexcelatexcel.com › home › using sum function only when cells are ticked
Using SUM Function Only When Cells Are Ticked | How To Excel At Excel
April 24, 2022 - Access this by right-clicking on the CheckBox. Select the cell link option, used with the conditional SUM or SUMIF Formula. The link cell links to this expenses sheet are set up in Column G to the right of the CheckBox.
🌐
YouTube
youtube.com › watch
Using the SUMIF Function with Checkbox Control - YouTube
Using the sumif function with checkbox control can significantly enhance your Excel projects, especially when dealing with large datasets that require quick ...
Published: April 3, 2024
🌐
JustAnswer
justanswer.com › microsoft-office › shrm1-sumif-values-check-tick-boxs-excel-mac.html
SUMIF with Checkboxes in Excel for Mac - Expert Guide
July 18, 2025 - SUMIF formulas not recognizing ... 365, checkboxes return TRUE (checked) or FALSE (unchecked). Use SUMIF with criteria TRUE to sum values linked to checked boxes....
🌐
The Bricks
thebricks.com › home › resources › how to sum checkboxes in excel
How to Sum Checkboxes in Excel
January 16, 2025 - For this, the SUMIF function is perfect. ... D2:D11 is the criterion range—the cells Excel checks for your condition (our linked TRUE/FALSE cells). TRUE is the criterion—it tells the function to focus only on rows where the checkbox is checked.
🌐
YouTube
youtube.com › watch
✅ Sum if Checkbox is Checked in Google Sheets - YouTube
If you need to sum up a column when a checkbox is checked, this short video will walk you through it.
Published: November 14, 2024
🌐
Microsoft Answers
answers.microsoft.com › en-us › msoffice › forum › all › check-boxes-in-excel › 2fbfa04a-3725-4e7e-a94d-424e7ae8d1d9
Check Boxes In Excel - Microsoft Q&A
January 10, 2023 - Help the next person who has this issue by indicating if this reply solved your problem. Click Yes or No below. ... No. And to use SUMIF in realtion with check boxes is not possible, you must assign each checkbox to a cell...