I'm trying to figure out why my custom function is throwing the #name error as if I'm entering it wrong. The function takes two cells and divides them and throws a string telling you if it's healthy, not, or warns you. Below is my VBA script that calculates everything. I'm not sure where I can go wrong with this? This is located in a module folder and it shows up when I enter it in formula. enter image description here
Public Function PHealth(Budget As Double, Actual As Double)
ph As Double
ph = Actual / Budget
If ph > 0.7 Then PHealth() = " Good"
End If
If ph < 0.7 And ph > 0.8 Then PHealth() = "Warning"
MsgBox "Warning Project is past 70% consumption"
End If
If ph < 0.8 Then PHealth() = "Poor"
MsgBox "Warining! Project Nearing 90% consumption. Get CO Signed"
End If
End Function