Hello Jean-Pierre
It cannot be done with just a formula but you can define a function that will allow you to do it using VBA. I have not tested this method from another site.
Right click any sheet tab
Select: View code
Goto the menu Insert>Module
Paste the following code into the window that opens on the right
Function IsFormula(cell_ref As Range)
IsFormula = cell_ref.HasFormula
End Function
Close that application to return to Excel
Now, try the function.
Enter a simple formula in cell A1: =SUM(Z1:Z10)
Enter this formula in B1: =IsFormula(A1)
You should get a result of TRUE.
You can then use this logical test in a standard IF function: =IF(IsFormula(A1),A1,5)
Regards
Harry