+ Reply to Thread
Results 1 to 26 of 26

Google Sheets: IF Formula on Checkbox

  1. #1
    Registered User
    Join Date
    03-03-2020
    Location
    PK
    MS-Off Ver
    MS Office 365
    Posts
    56

    Google Sheets: IF Formula on Checkbox

    Hi

    I have a Google Spreadsheet on which I want to use the IF formula on Checkboxes. What I'm trying to achieve is that if the box is checked (TRUE), the formula should give "Paid" and if it is unchecked (FALSE), the formula should give "Unpaid"

    Since it's on Google Sheets I can't share the file itself but I have attached a screenshot. I used the formula =IF(E9=TRUE,"Paid","Unpaid") but this ends up giving an error each time.
    Attached Images Attached Images

  2. #2
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: Google Sheets: IF Formula on Checkbox

    are those boxes actually PART of cells? I wouldn't think so. how did you add them? I don't use goog shts. according to both of these, it seems like the issue is that cell e9 is NOT a box, and there is no pointer associated, which makes perfect sense:

    https://support.google.com/docs/answ...DDesktop&hl=en

    https://support.google.com/a/users/answer/9308622?hl=en

    looks like the code is right tho:

    https://support.google.com/docs/answer/3093364?hl=en

  3. #3
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: Google Sheets: IF Formula on Checkbox

    One would think the checkbox would have to be linked to E9

  4. #4
    Registered User
    Join Date
    03-03-2020
    Location
    PK
    MS-Off Ver
    MS Office 365
    Posts
    56

    Re: Google Sheets: IF Formula on Checkbox

    Quote Originally Posted by vba_php View Post
    are those boxes actually PART of cells? I wouldn't think so. how did you add them? I don't use goog shts. according to both of these, it seems like the issue is that cell e9 is NOT a box, and there is no pointer associated, which makes perfect sense:

    https://support.google.com/docs/answ...DDesktop&hl=en

    https://support.google.com/a/users/answer/9308622?hl=en

    looks like the code is right tho:

    https://support.google.com/docs/answer/3093364?hl=en

    I've tried all these references but they don't work. And yes, these checkboxes are actually part of the cell. The checkbox was inserted using Data Validation - Checkbox (tickbox). I also have the option to insert value if TRUE/FALSE and the cell shows the Checkbox but you can see the value in the formula bar too. But when I use the IF function, I end up getting the same error.

  5. #5
    Registered User
    Join Date
    03-03-2020
    Location
    PK
    MS-Off Ver
    MS Office 365
    Posts
    56

    Re: Google Sheets: IF Formula on Checkbox

    Any idea how it's done on Google Sheets?

  6. #6
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: Google Sheets: IF Formula on Checkbox

    Quote Originally Posted by davesexcel View Post
    One would think the checkbox would have to be linked to E9
    thanks Dave. I should have expected this from you, as per our altercations in the past. My apologies for not giving all info the world has to offer as the answer. I will go ahead and reply to the OP now if I can.
    Last edited by vba_php; 01-01-2021 at 09:19 PM.

  7. #7
    Registered User
    Join Date
    03-03-2020
    Location
    PK
    MS-Off Ver
    MS Office 365
    Posts
    56

    Re: Google Sheets: IF Formula on Checkbox

    Can you please explain what he said?

  8. #8
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: Google Sheets: IF Formula on Checkbox

    are you talking to me, zain? in excel, check boxes can be LINKED to cells, and thus, a reference, or sometimes called a ""pointer"" is created. that allows code to be easily written to manipulate the boxes, regardless of what actions you want it connected to.

  9. #9
    Registered User
    Join Date
    03-03-2020
    Location
    PK
    MS-Off Ver
    MS Office 365
    Posts
    56

    Re: Google Sheets: IF Formula on Checkbox

    Quote Originally Posted by vba_php View Post
    are you talking to me, zain? in excel, check boxes can be LINKED to cells, and thus, a reference, or sometimes called a ""pointer"" is created. that allows code to be easily written to manipulate the boxes, regardless of what actions you want it connected to.
    Yes I was talking to you. Okay I get what you're saying. So I googled on how to link the checkbox to cells but I cant find anywhere how to do it on Google Sheets. Do you know to do it? If this works, then I guess the IF formula should work, hopefully.

  10. #10
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: Google Sheets: IF Formula on Checkbox

    are you sure you looked it up? this seems to explain it very well:

    https://www.benlcollins.com/spreadsh...eets-checkbox/

    does it not?

  11. #11
    Registered User
    Join Date
    03-03-2020
    Location
    PK
    MS-Off Ver
    MS Office 365
    Posts
    56

    Re: Google Sheets: IF Formula on Checkbox

    Quote Originally Posted by vba_php View Post
    are you sure you looked it up? this seems to explain it very well:

    https://www.benlcollins.com/spreadsh...eets-checkbox/

    does it not?
    Yes it does explain it properly and as you can see in the screeshots attached I am doing exactly as it says but I still end up getting an ERROR for some reason which is what I need help with. I have attached a screenshot of the Formula used and the Data Validation applied on Cell E9 where the tickbox is
    Attached Images Attached Images

  12. #12
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: Google Sheets: IF Formula on Checkbox

    You may just need to reference E9 not use a formula.

    2021-01-02_2-31-52.jpg

  13. #13
    Registered User
    Join Date
    03-03-2020
    Location
    PK
    MS-Off Ver
    MS Office 365
    Posts
    56

    Re: Google Sheets: IF Formula on Checkbox

    I tried that way too but the second I use the IF formula, I get an error. Used cell reference to get "Paid" text in one cell. And then applied the IF formula on the cell with the text. Still getting the same error.
    Last edited by AliGW; 01-02-2021 at 04:43 AM. Reason: PLEASE don't quote unnecessarily!

  14. #14
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: Google Sheets: IF Formula on Checkbox

    I didn't notice this earlier, the formula used in Post#11 is incorrect(extra quotation and bracket), it should be.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  15. #15
    Registered User
    Join Date
    03-03-2020
    Location
    PK
    MS-Off Ver
    MS Office 365
    Posts
    56

    Re: Google Sheets: IF Formula on Checkbox

    Yeah I forgot to mention, I fixed that formula right after. Still getting the same error.
    Last edited by AliGW; 01-02-2021 at 05:11 AM. Reason: PLEASE stop quoting unnecessarily!

  16. #16
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,779

    Re: Google Sheets: IF Formula on Checkbox

    Administrative Note:

    Please don't quote whole posts, especially when you are responding to the one immediately preceding your own - it's just clutter. It's OK to quote if you are responding to a post out of sequence, but limit quoted content to a few relevant lines that makes clear to whom and what you are responding. Thanks!

    For normal conversational replies, try using the QUICK REPLY box below or the REPLY button instead of REPLY WITH QUOTE.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  17. #17
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: Google Sheets: IF Formula on Checkbox

    What is the formula you are using that is in error?

  18. #18
    Registered User
    Join Date
    03-03-2020
    Location
    PK
    MS-Off Ver
    MS Office 365
    Posts
    56

    Re: Google Sheets: IF Formula on Checkbox

    The exact same formula that you posted above.

  19. #19
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,779

    Re: Google Sheets: IF Formula on Checkbox

    Try this:

    =if(F9=TRUE,"Paid","Unpaid")

    If it's the same as Excel, then the tick box is just a TRUE/FALSE (1/0) switch, and the formatting you've set is not the underlying cell value.
    Last edited by AliGW; 01-02-2021 at 06:44 AM.

  20. #20
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: Google Sheets: IF Formula on Checkbox

    I don't get an error with
    =if(F9="Paid","Paid","Unpaid")

    Post #12 mentions just =E9 would be enough.

    Also in Post #11 you are missing a quotation after "Paid

  21. #21
    Registered User
    Join Date
    03-03-2020
    Location
    PK
    MS-Off Ver
    MS Office 365
    Posts
    56

    Re: Google Sheets: IF Formula on Checkbox

    Yeah but in some cases it might be Unpaid too so "=E9" wouldn't be enough.

    Basically whenever I use the IF function on Google Sheets, I get this error. I don't understand why. If I give you the link of the sheet, will you be able to see what the problem is exactly?

  22. #22
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,779

    Re: Google Sheets: IF Formula on Checkbox

    Did you try my suggestion?

    Yes, post a link.

  23. #23
    Registered User
    Join Date
    03-03-2020
    Location
    PK
    MS-Off Ver
    MS Office 365
    Posts
    56

    Re: Google Sheets: IF Formula on Checkbox

    Yes I tried that too and a few other alternatives too but the second I put in the IF function, I get an error. I don't understand why. This exact same formula works on Excel 365 but not on Google Sheets.

    Here's the link - https://docs.google.com/spreadsheets...t?usp=drivesdk

  24. #24
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,779

    Re: Google Sheets: IF Formula on Checkbox

    If you hover over the formula bar, it tells you that the syntax needs semi-colons:

    =IF(F9="Paid";"Paid";"Unpaid")

    or:

    =IF(B9="Paid";"Paid";"Unpaid")

    From the tooltip:

    IF(logical_expression; value_if_true; value_if_false)

    Example
    IF(A2 = "foo"; "A2 is foo"; "A2 is not foo")
    About
    Returns one value if a logical expression is 'TRUE' and another if it is 'FALSE'.
    logical_expression
    An expression or reference to a cell containing an expression that represents some logical value, i.e. 'TRUE' or 'FALSE'.
    value_if_true
    The value that the function returns if 'logical_expression' is 'TRUE'.
    value_if_false
    The value that the function returns if 'logical_expression' is 'FALSE'.
    Last edited by AliGW; 01-02-2021 at 07:11 AM.

  25. #25
    Registered User
    Join Date
    03-03-2020
    Location
    PK
    MS-Off Ver
    MS Office 365
    Posts
    56

    Re: Google Sheets: IF Formula on Checkbox

    Ohhh thank you so much!

  26. #26
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,779

    Re: Google Sheets: IF Formula on Checkbox

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ 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. dynamic formula to count through existing and new sheets(In google sheets)
    By wlinksanju in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 1
    Last Post: 11-26-2020, 09:16 PM
  2. Formula's not converting from Google Sheets
    By TEN36VX in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-17-2019, 07:59 PM
  3. [SOLVED] Google Sheets: Formula Required For Look Up Value
    By sijostephen in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 11
    Last Post: 07-01-2019, 04:39 AM
  4. Google Sheets: formula for best 5 of last 10 [MOVED]
    By k.j. in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 6
    Last Post: 08-26-2018, 08:15 AM
  5. Google Apps Script for Google Sheets Pulling Formulas from Master to Several Slave Sheets
    By excelroofing in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 4
    Last Post: 08-22-2018, 02:06 AM
  6. email row contents based on cell values (google sheets populated by google forms)
    By reedg in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 0
    Last Post: 01-13-2016, 02:55 PM
  7. Basic Sum Formula in Google Sheets
    By lesoies in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 7
    Last Post: 08-27-2013, 04:05 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