+ Reply to Thread
Results 1 to 10 of 10

subtract if tick box is ticked

  1. #1
    Registered User
    Join Date
    01-23-2013
    Location
    cambridge
    MS-Off Ver
    Excel 2010
    Posts
    11

    subtract if tick box is ticked

    hi excelforum members,

    i got some very good help last year from you folks, so thought i'd test out your knowledge again...

    it might be very simple... or it might not be possible, i just have no idea.

    i've got a "battery club" spreadsheet in excel 2010. the user has to tick one of those 'wingdings' tickboxes if the battery has been sent. what i want to be able to do is calculate how many packs remaining calculated from the 'purchased' minus 'wingdings ticked'.

    purchased 1st date 2nd date 3rd date 4th date 5th date 6th date remaining
    12 18/04/2014 [ ] 25/04/2014 [ ] 02/05/2014 [ ] 09/05/2014 [ ] 16/05/2014 [ ] 23/05/2014 [ ] ???

    is there an adaption of the countif formula that would work?

    many thanks

    infamousurge

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: subtract if tick box is ticked

    I think we're going to need to see a sample file that demonstrates what you're wanting to do.

    Make it SMALL and show us what results you expect.

    A SMALL file is one in which you don't have to scroll either vertically or horizontally to see the data!
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    01-23-2013
    Location
    cambridge
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: subtract if tick box is ticked

    ok cool, here goes

    file is attached, the formula im looking for is the quantity remaining column

    thanks
    Attached Files Attached Files

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: subtract if tick box is ticked

    Sorry, your file is too big for me.

  5. #5
    Registered User
    Join Date
    01-23-2013
    Location
    cambridge
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: subtract if tick box is ticked

    Battery Club small.xlsx

    is this better?

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: subtract if tick box is ticked

    Ok, that's better!

    Looks like you're using ActiveX checkboxes.

    You have to set the linked cell property then you can use a COUNTIF function to count how many checkboxes are "checked" or "unchecked". When a checkbox is checked the linked cell will display TRUE. If the checkbox is then unchecked the linked cell will display FALSE.

    =COUNTIF(range,TRUE)
    =COUNTIF(range,FALSE)

    You probably don't want the user to see these cell entries so what you can do is set the font color of the cell to be the same as the background color which has the net effect of making the cell look empty/blank.

  7. #7
    Registered User
    Join Date
    01-23-2013
    Location
    cambridge
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: subtract if tick box is ticked

    great, thank you. it seemed to work well, i was unaware you could link the checkboxes to the cells, so thanks.

    my next question... is there a way of linking 2,000 check boxes to the cell that they are situated in, without doing it individually

    thanks

  8. #8
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: subtract if tick box is ticked

    That's a lot of checkboxes!

    You could probably do it with VBA but I'm not much of a programmer and don't know how to do it.

    An alternative is to use an event macro that inserts an "X" in the cell when double clicked. Then there's no fooling around with linked cells. You'd count the cells with X's.

    =COUNTIF(range,"X")

    Again, I'm not much of a programmer and someone else would need to help with the code.

  9. #9
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,293

    Re: subtract if tick box is ticked

    An alternative is to use an event macro that inserts an "X" in the cell when double clicked. Then there's no fooling around with linked cells. You'd count the cells with X's.
    Something like this; with this formula to count.
    =COUNTIF(range,"p")
    Please Login or Register  to view this content.
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  10. #10
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: subtract if tick box is ticked

    I could have done it if the range was a contiguous range.

    Now I see how you defined a non-contiguous range in your code.

+ 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. Clear a cell when Tick box is ticked
    By frank35 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-12-2013, 04:23 PM
  2. [SOLVED] tick all check box in just one click and then count up the selected tick box...
    By pejoi in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-05-2013, 09:13 PM
  3. Make 1 a tick in a tickbox and 0 no tick
    By ExcelFailure in forum Excel General
    Replies: 2
    Last Post: 04-02-2013, 07:28 AM
  4. Excel 2007 : one tick box selects multiple tick boxes
    By brentroberts in forum Excel General
    Replies: 2
    Last Post: 12-31-2011, 09:29 PM
  5. make a tick box only tickable if another is ticked
    By regithier in forum Excel General
    Replies: 1
    Last Post: 02-27-2009, 12:34 PM

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