+ Reply to Thread
Results 1 to 9 of 9

Check box formula and summary

Hybrid View

  1. #1
    Registered User
    Join Date
    01-29-2008
    Posts
    4

    Check box formula and summary

    My spread sheet has 10 columns, and each text heading has a numeric value as well. There are 12 rows listed, each being a hospital. I have a check box in each row/column and what I would like to do is the following:

    1. When the box is checked for a hospital, it means they offer the service represented by the title of the column. Lets say the value attached to that title is 5I want the check box to remain and remember the value.
    2. I would like to sum the hidden values both vertically (row 13) and horizonally (row 11) after all boxes have been checked (or not).

    Is this possible?? I have attached an abbreviated sample. Thanks for yoiur help.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    01-25-2008
    Location
    The Netherlands
    MS-Off Ver
    2002, 2003, 2007
    Posts
    94
    Hi Jellis,

    Please find attached a solution to your problem.
    I have deleted all the checkboxes, because you do not really need them.

    Instead I created a (Yes / No) list as Data Validation
    (see corresponding menu as well).
    To calculate the totals, I used the COUNTIF function that counted all the Yes'es in each row/column.

    Hope this helps.
    Attached Files Attached Files
    J.

  3. #3
    Registered User
    Join Date
    01-29-2008
    Posts
    4
    Thanks for your quick reply. The result is not exactly what I had in mind. I am not looking for a count but a sum total of values. The reason I thought check boxes is because I assumed I would need a formula behind each check box in the first column so that when it was checked, it would recognize a value of 5, and if the check box in the 2nd column check, it would recognize it as the value 4. Then I could do an easy sum at the end of each row and the bottom of each column.

    I didn't want the cells all cluttered so I though if I could just use the check box, and not have the corresponding value visible, it would look much better. Can this be done? If so, I am struggling with the formula for the check box.

    If there is another way to accomplish this, I am open for suggestions. This has to go to our senior VPs so I am being a bit more particular.

  4. #4
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    I took your file and modified it a bit, still using the check marks. Here is what you will need to do in order to accomplish this in your full file:

    -You need to assign the Link Cell property of each of the check boxes to the cell in which it is located. To do this, right-click on the check box, and select properties. You will see Linked Cell. Next to this, type in the cell reference (i.e. B2). This can be a tedious process if you have a lot of check boxes. However, you could use a quick VBA procedure to assign the linked cell property to all check boxes on the sheet:
    Sub ckboxes()
        Dim Cb As OLEObject
        For Each Cb In Sheets("Sheet1").OLEObjects   'change to your sheet name
            If Cb.Name Like "CheckBox*" Then _
                Cb.LinkedCell = Cb.TopLeftCell.Address
        Next Cb
    End Sub
    -Format the linked cells (the cells behind the check boxes) using a custom format of 3 semi-colons: ;;; This will cause the font to be invisible.

    HTH

    Jason
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    01-25-2008
    Location
    The Netherlands
    MS-Off Ver
    2002, 2003, 2007
    Posts
    94
    Hi there,

    Please find the ajusted solution that calculates sums.
    I have added an additional line containing the values you want to sum.
    dont forget to hide this row once you have finished your list.

    I made use of SUMIF and COUNTIF * value to sum the values

    Hope this solution is what you are looking for
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    01-29-2008
    Posts
    4
    That is exactly what I am looking for. You have been a great help. I work a lot with Access but rarely do this type of thing with Excel, so again I am learning.

    If I can ask just one other question please. What if you only wanted the Yes to show, and if it is a no it would be blank? Would you still use the drop down but eliminate the no option? I ask this question in the event they want a cleaner look.

  7. #7
    Registered User
    Join Date
    01-25-2008
    Location
    The Netherlands
    MS-Off Ver
    2002, 2003, 2007
    Posts
    94
    Hi,

    Good to hear you are happy :D

    Yes, sure you can get rid of the No's and the Data Validation that has been set on each cell, as long as you use 'Yes' as the value to do the SUMIF / COUNTIF.

    Of cours you could also replace the Yes by an X (and adjust the SUMIF/COUNTIF function calls accordingly (to simulate the checkbox)

    See also the example file I attached
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1