Formula column issue - throwing error as "specified formula is invalid'

Formula column issue - throwing error as "specified formula is invalid'

Hi
I am trying to build a formula column as follows but it is throwing error saying " specified formula is invalid", i did other formulas but did not face this issue and i could not find out where is the issue:

if("CurrentPreviousMonth" = 'Not Paid', 'Not Paid',
if("CurrentPreviousMonth" = 'Paid Both months', if("TMC"+"PMC">999, '>=1000', '<1000'),
if("CurrentPreviousMonth" = 'Paid in November', if("PMC">499, '>=500', '<500'),
if("CurrentPreviousMonth" = 'Paid in October', if("TMC">499, '>=500', '<500')))))

Appreciate the help. Thanks in advance.