Sometimes it is necessary to use formulas to find out detailed information and parameters about a cell in order to use it in calculations. For example, find out the number or text in a cell, or what number format is set in it. This can be done using the function CELL (CELL).
The function syntax is as follows:
=CELL(Parameter; Address)
where Address – this, of course, is a link to the desired cell, but Parameter – this is a code word that determines what kind of information about the cell we want to receive. This argument has several possible values:
Let’s take a look at a couple of tricks to put this function into practice.
For example, you can get the name of the current sheet with a formula using the function CELL with the parameter “File name“And extracts all characters to the right of the closing square bracket:
You can also check the data type in the cell (parameter “type”) and display an error message instead of calculations if text is entered or the cell is empty:
Or highlight with conditional formatting all unprotected cells in a given range:
- Enable / disable highlighting of unprotected cells by macro
- Conditional Formatting in Excel