Forum Discussion
Help Correcting a Formula
- Jul 24, 2022
Steven560 The error occurs due to incorrect placement of several brackets.
A correct syntax would be (note that you don't need all the SUM functions):
=IF(A4="","",IF(A4-F49>0,0,IF(A4-F49>0,A4-F49)))
But, this formula makes no sense as you include two conditions IF(A4-F49>0,....... . You probably want the first one to be IF(A4-F49<=0,...... .
And then you could just write: =MIN(0,A4-F49)
Or, if you must return a blank if A4 is blank:
=IF(A4="","",MIN(0,A4-F49))
Steven560 The error occurs due to incorrect placement of several brackets.
A correct syntax would be (note that you don't need all the SUM functions):
=IF(A4="","",IF(A4-F49>0,0,IF(A4-F49>0,A4-F49)))
But, this formula makes no sense as you include two conditions IF(A4-F49>0,....... . You probably want the first one to be IF(A4-F49<=0,...... .
And then you could just write: =MIN(0,A4-F49)
Or, if you must return a blank if A4 is blank:
=IF(A4="","",MIN(0,A4-F49))
=IF(A4="","",IF(F49="",A4,IF(A4-F49<0,0,IF(A4-F49>0,A4-F49))))
Thank you very much for your help.
- Riny_van_EekelenJul 24, 2022Platinum Contributor
Steven560 Fine with me, but be aware that when A4 = F49, this will return FALSE. Not sure if that is likely to happen, of course. Up to you.
- Steven560Jul 24, 2022Copper Contributor
Already encountered that. I changed the formula to this:
=IF(A4="","",IF(F49="",A4,IF(A4-F49<=0,0,IF(A4-F49>0,A4-F49))))
Working perfectly now. Thanks again.
- Detlef_LewinJul 24, 2022Silver Contributor