+ Reply to Thread
Results 1 to 5 of 5

Checkbox IF Functions

  1. #1
    Registered User
    Join Date
    04-13-2009
    Location
    Cambridge, Ontario
    MS-Off Ver
    Excel 2003
    Posts
    3

    Question Checkbox IF Functions

    I am trying to calculate checkboxes in my excel worksheet and am really having a hard time in doing so. - I am usually pretty good at formulas but this one is causing me to drink as it is probably something pretty simple that I have forgotten to do.

    Here is my dilemma:

    Equipment Rentals.xls

    I am trying to calculate that if cell C4 is checked then it will calculate cell a4*d4 (cost of equipment x number of days), or if cell E4 is checked it will calculate cell F4 *A4 and if cell G4 is check it will calculate cell H4*A4. - the totals will be calculated in cell I4 depending on what check box is checked.

    When I write the formula as
    =IF(C4=TRUE,A4*D4,IF(E4=TRUE,A4*F4, IF(G4=TRUE,A4*H4,0)))

    Please help me!!!
    Last edited by Fingerstidge; 04-14-2009 at 12:03 PM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    re: Checkbox IF Functions

    Checkboxes need to be linked to a cell for formulaic referencing. If you go into Design Mode and then click on the PROPERTIES of the checkbox, there is a LinkedCell option there. I linked your three boxes to the cells underneath them, and painted the font white so the TRUE responses won't show.

    Then I set your formula to:

    =((C4*D4)+(E4*F4)+(G4*H4))*A4

    The problem I foresee is that looks like the beginning of a long list. I see you manually creating a LOT of checkboxes and linking them to cells.

    It's just as useful to leave out the checkboxes and put a reference IN the cell itself, like an X and use a slightly different formula

    =((ISTEXT(C7)*D7)+(ISTEXT(E7)*F7)+(ISTEXT(G7)*H7))*A7
    Attached Files Attached Files
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    re: Checkbox IF Functions

    easier to use option buttons from the forms toolbar inside a group box
    link to a cell I used k4 then stick formula in totals
    Attached Files Attached Files
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  4. #4
    Registered User
    Join Date
    04-13-2009
    Location
    Cambridge, Ontario
    MS-Off Ver
    Excel 2003
    Posts
    3

    Smile Re: Checkbox IF Functions

    Thank you for your help, I really appreciate it.

    Thanks again!!

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Checkbox IF Functions

    If that takes care of your need, be sure to EDIT your original post (Go Advanced) and mark the PREFIX box [SOLVED]

+ 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