Pregunta

In the new Google sheets, they added custom formula for conditional formatting. I want the cell to be blue if the cell is a value and black if it is a formula ... I've looked through all of the is type functions, there doesn't seem to be a isformula kind of function.

Does anybody know if this is possible?

¿Fue útil?

Solución

the isFormula is the standard function in new Google Sheets. You don't have to implement yours one.

=isFormula(F2:G5)

Otros consejos

It looks like there is a hidden built-in function ISFORMULA() from google. I realized when I deleted my own function and was still working. I tried it in a new spreadsheet and still works. No cache issue.

I don't think there exists a function which could identify if the contents of a cell are populated based on formula or not. But this could be achieved via a small script

function isformula(cell) {
  if (cell.getFormula()) {
    return true;
  } else {
    return false;
  }
}

Then in conditional formatting you could use =isformula(A1) and set the format as you want.

PS: The above code snippet works only for the new google sheets

At this time, ISFORMULA is a Google spreadsheets built-in function and it's currently included in the official documentation - > https://support.google.com/docs/answer/6270316?hl=en

=isFormula(A1) works now, built-in (even though it's hidden). (As has already been said by @JuanPérez.)

Literal (user-entered) values can be tested for with =NOT(OR(isFormula(A1);isBlank(A1))).

I created a Google Sheet with tests/ demos: https://docs.google.com/spreadsheets/d/1VZeVSMHbPS8nAx0E4bQlWW9FygPV1R8-nb0i-vKEt3k
Make a copy… via the File menu if you’d like to play around.
Suggestions for improving the Sheet are welcome!

enter image description here

You can just use ISFORMULA(cell) It's undocumented, but it works. If you're using Google Sheets with translated formula names, use English name of the formula. (So for example if AND(...) doesn't work and you have to type ORAZ(...) then remember that ISFORMULA(...) doesn't get translated into CZY.FORMUŁA(...) and has to be written in English instead.)

To elaborate slightly on @Konstant's answer while ignoring the script there but addressing some of the specifics of the question:

SO23237313 example

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top