Hello , The UDF function works only for one of the conditions and errors if there is more than one, using else if did not want to work, What am I doing wrong? Thank you
Function Calc(rowaddress)
If (cells(rowaddress.row,6).value="F" or cells(rowaddress.row,6).value="P"
And cells(rowaddress.row,16).value=0
And cells(rowaddress.row,10).value<24)
then Calc=24-cells(rowaddress.row,10).value
Else If (cells(rowaddress.row,6).value="F" or cells(rowaddress.row,6).value="O"
And cells(rowaddress.row,16).value<>0
And cells(rowaddress.row,10).value>24)
then Calc=24+cells(rowaddress.row,10).value
else calc=0
I inherited a long formula that a function will do wonders with it, it has 9 different conditions, any help will be greatly appreciated.
Thank you