Formula custom field question

Formula custom field question

Hello, I am looking to create a custom field that tracks the date that a custom field is modified. So, for example field A shows the date that field B was last modified. So far, we're looking at creating an integer custom field to act as a trigger variable to store either a 1 or a 0 (which will track when the status field is changed), and a formula custom field to display the date of the last change in the status field. We created a few attempts at a formula (shown below) to handle this, but when we attempted to save the formula we received a syntax error stating we were missing some quotes, but after extensive searching we cannot find where we are missing the quotes. It's possible that at least part of the problem is that we're trying to enter more than one statement in the formula for the field.  As a way to prevent this, we also tried using semi-colons in our formula to execute two actions in a single If statement, but we aren't sure if Zoho supports that approach.  Please review our approaches below and let me know if there is a way to modify either approach to get what we need.

We have three fields. Contact status, status trigger, and status change.
Contact status is either "Active" or "Inactive"
Status trigger is either 1, or 0.
Status change is one of the formulas included below.

Status change field details:

Approaches to populating the Status Change field
Label: Status Change
Field Type: Formula
Return Type: DateTime 


//One statement per change (uses semi-colons)

If(And(${Contacts.Status}=='Active',${Contacts.Status Trigger}==0),Datepart(Now()); Replace(${Contacts.Status Trigger},0,1),)

If(And(${Contacts.Status}=='Inactive',${Contacts.Status Trigger}==1),Datepart(Now()); Replace(${Contacts.Status Trigger},1,0),)


//Two statements per change (does not use semi-colons)

If(And(${Contacts.Status}=='Active',${Contacts.Status Trigger}==0),Datepart(Now()),)
If(And(${Contacts.Status}=='Active',${Contacts.Status Trigger}==0),Replace(${Contacts.Status Trigger},0,1),)

If(And(${Contacts.Status}=='Inactive',${Contacts.Status Trigger}==1),Datepart(Now()),)
If(And(${Contacts.Status}=='Inactive',${Contacts.Status Trigger}==1),Replace(${Contacts.Status Trigger},1,0),)