Forum Discussion

GeeJay's avatar
GeeJay
Copper Contributor
Mar 07, 2022
Solved

Hide a formula

I have a column which contains a formula

=A1&"California",&B1

I want to hide the formula. When I do that using protection tab, I was able to hide the formula but my custom text is still visible. Any way I can hide all of the contents in a formula cell?

  • GeeJay 

     

    Oh! I just realized the simplest solution. So long as I'm correct that the original situation was that the formula, per se, is hidden and it's only the hardcoded "California" that is appearing.

     

    Just make the result visible only after A1 and B1 have content in them, using an IF condition.

    =IF(AND(A1="",B1=""),"",A1&"California"&B1)

    This will keep C1 blank until entries are made in A1 and B1.

    Depending on what goes into A1 and B1, assuming they're text fields of some kind, you might want to put spaces before and after the word "California"

    =IF(AND(A1="",B1=""),"",A1&" California "&B1)

     

7 Replies

  • mathetes's avatar
    mathetes
    Silver Contributor

    GeeJay 

    You wrote:

    I want to hide the formula. When I do that using protection tab, I was able to hide the formula but my custom text is still visible. Any way I can hide all of the contents in a formula cell?

     

    I can think of a couple of ways. First, though, if you don't mind, I'd kind of want to know why? Presumably it's serving a purpose of some kind...i.e., the resulting custom text is being used somewhere, somehow. Right?

     

    Anyway, here are several fairly easy ways to hide all the contents:

     

    1. put the cell, formula and all, in a column of its own, and hide the column -- you can still refer to it and use it in whatever way you are using it.
    2. put the cell, formula and all, in a  row of its own, and hid the row -- you can still refer to it...
    3. put the cell, formula and all, on a different tab and hide the tab  -- you can still refer to it ...
    4. change the color of the text to the color of the background -- less effective, and depending on who else is using the workbook (from whom apparently you want it to be hidden) still readily changed to be visible 

     

    • GeeJay's avatar
      GeeJay
      Copper Contributor
      Thanks! I am sorry if I was not super clear in my original post. I want to keep the column, I just don’t want to display the formula (everything that appears after the = sign). I will be sending out the spreadsheet as a template so when people add values in A and B column, they would get a result in column C ( column c contains the formula).
      • mathetes's avatar
        mathetes
        Silver Contributor

        GeeJay 

        The first time you wrote:

        I want to hide the formula. When I do that using protection tab, I was able to hide the formula but my custom text is still visible. Any way I can hide all of the contents in a formula cell?

         

        Meaning, if I take the words for what they, you know, mean...you were able to hide the formula. But you wanted to hide everything.  It was quite clear.

         

        The second time around you wrote this:

        I am sorry if I was not super clear in my original post. I want to keep the column, I just don’t want to display the formula (everything that appears after the = sign). I will be sending out the spreadsheet as a template so when people add values in A and B column, they would get a result in column C ( column c contains the formula).

         

        So you want them to be able to see those results in column C--is that right? And you don't want them to see the formula, right?

         

        But isn't that exactly what you were getting in the first place, before your first post.... Seeing the results but not the formula?

         

        It's possible that I'm missing something here, but I need to ask you to clarify your clarification.

Resources