Hi Zohar,
Not sure if this works, but maybe worth a try....
In Excel, the #SPILL! error occurs when a formula that is trying to output multiple values (a "spill" range) encounters a problem. This can happen for various reasons, such as if there is already data in the cells where the spill range would go, or if the formula references itself.
There isn't a direct function like ISNA specifically for #SPILL! errors, but you can use a combination of functions to handle or check for #SPILL! errors indirectly. One approach is to use the IFERROR function to catch the error and handle it appropriately.
Here's an example of how you might use IFERROR to handle a #SPILL! error:
=IFERROR(your_formula, "Error: #SPILL!")
In this formula, your_formula is the formula that might cause a #SPILL! error. If the formula results in a #SPILL! error (or any other error), the IFERROR function will return "Error: #SPILL!" instead of the error.
If you need to specifically identify the #SPILL! error, you might need to use a more complex approach involving VBA (Visual Basic for Applications) to create a custom function that checks for #SPILL! errors. Here's a simple example of how you could do this:
- Press Alt + F11 to open the VBA editor.
- Insert a new module by right-clicking on any of the existing modules or the workbook name in the Project Explorer and selecting Insert > Module.
- Copy and paste the following VBA code into the new module:
Function IsSpillError(cell As Range) As Boolean
On Error Resume Next
IsSpillError = (cell.Value = CVErr(xlErrSpill))
On Error GoTo 0
End Function
- Close the VBA editor and return to your Excel worksheet.
- Use the custom function IsSpillError in your worksheet like this:
=IsSpillError(A1)
Replace A1 with the cell reference you want to check. This function will return TRUE if the cell contains a #SPILL! error and FALSE otherwise.
Hope this helps
plettieri