+ Reply to Thread
Results 1 to 6 of 6

[SOLVED] Help- Want to subtract values based on if check box is checked

  1. #1
    Registered User
    Join Date
    01-01-2015
    Location
    USA
    MS-Off Ver
    2013
    Posts
    4

    Question [SOLVED] Help- Want to subtract values based on if check box is checked

    I can create excel worksheets for myself but anything too complex and I am at my limit till I can see how it is done. I have a spreadsheet that I setup for my bills for this year, as you can see from the example I have added check boxes to the spreadsheet. What I would like it to do is subtract the value in the check box next to it from the total and put that total in the orange area. So if say the total is 1200 and the check box is in a cell with 10 dollars then the orange box would show 1190 dollars. I am not sure if this can be done or how and have tries looking it up.

    Thanks in advance for reading this and hopefully someone will have a solution.
    Attached Files Attached Files
    Last edited by oneuglydude; 01-02-2015 at 06:49 AM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,675

    Re: Help- Want to subtract values based on if check box is checked or nothing if unchecked

    To use the state of a checkbox in logic for calculations without having to use macros, you have to link the checkbox to a cell. To establish the link, go into Design mode, right click on the checkbox, select Format Control, click on the Control tab, and set Cell Link to the desired cell. Now the cell will have TRUE if the box is checked and FALSE if it is not.

    To do this I have added a column to hold the checkboxes and linked cells. Then see the formula I use to take into account the TRUE/FALSE values.

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Let me know if you need an explanation of how this formula works.

    The only flaw is that the TRUE/FALSE values are visible. One way to mask them is to format the text to be the same color as the fill color.
    Attached Files Attached Files
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Help- Want to subtract values based on if check box is checked or nothing if unchecked

    First of all you need to finish with check boxes set up. What you need is go to Properties for each check box and under Control tab enter a cell reference in the Cell link field. That way when you click on check box it will return TRUE and if the check box cleared it will return FALSE. Then you can use SUMIF formula to calculate checked or unchecked items.

    Please see attached file.
    Attached Files Attached Files
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Help- Want to subtract values based on if check box is checked or nothing if unchecked

    Hi,

    See attached for one way. The formula is an array formula so is entered with Ctrl Shift Enter.

    However I can't help thinking this is quite a contrived way of doing it. You'll need to add many check boxes and link them all to the parallel sheet2.

    Personally I'd enter data in a normalised 2D database. i.e. columns for

    Date
    Bill Ref.
    Amount
    Paid Indicator

    The Paid indicator could be a drop down validation with a Yes or No choice. Your analysis would then come from a simple Pivot Table which would provide a lot more flexibility. The database could carry an Autofilter so that you could quickly locate a Bill Ref.
    Attached Files Attached Files
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  5. #5
    Registered User
    Join Date
    11-04-2013
    Location
    Greece, Piraeus
    MS-Off Ver
    Excel 2013
    Posts
    1

    Re: [SOLVED] Help- Want to subtract values based on if check box is checked

    Hello,
    I found these examples very helpful for my spreadsheet!
    Although I will like to ask you what if I want to do the same thing on the next month (Feb) with new checkboxes and new prices? Is there an easy way to copy the checkboxes and their true/false value to the next month easily?

    Thanks in advance

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: [SOLVED] Help- Want to subtract values based on if check box is checked

    Hi kracken_74 and welcome to the forum.

    Please take some time to read the forum rules. This one in particular.

    2. Don't post a question in the thread of another member -- start your own. If you feel it's particularly relevant, provide a link to the other thread. You may include up to 3 links to other URLs in a single post, no more, so only link to the relevant pages.


    Additionally, though there is no rule concerning this that I am aware of, posting to an old thread is not likely to get response from the original participants. Again, you are better off starting a new thread.

    Again, welcome.
    Dave

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Check boxes are unchecked in Listbox that were checked off before. How can I stop this?
    By Rochelle711 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-22-2014, 08:58 PM
  2. how to create checked and unchecked checkboxes based on three criterion?
    By pejoi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-12-2014, 09:37 PM
  3. Set Checkboxes to Checked/Unchecked in Range based on Values in Other Range
    By lowprofile in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-28-2013, 11:25 AM
  4. [SOLVED] userform checked and unchecked instances
    By arleutwyler in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-18-2013, 02:20 AM
  5. Assigning values to total based on check boxes checked
    By AvocadoRivalry in forum Excel General
    Replies: 1
    Last Post: 09-15-2009, 10:11 AM

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