# Only 1/2 of my formula is working

Options
✭✭

I am currently creating a Smartsheet to track payment issues. When a date has been inputted along with a status the future date generates to an additional column to display how long it will take for the payment issue to be resolved. However, only half of my formula is working and I cannot any problems in the formula which I have copy and pasted below. Can anyone advise?

Thank you so much😊

=IF(OR([AP Payment Status]@row = "Invalid Approver", [AP Payment Status]@row = "Reprocessed", [AP Payment Status]@row = "Invalid Coding"), [Date Flagged to AP]@row + 2, AND(OR([AP Payment Status]@row = "Payment Rejected", [AP Payment Status]@row = "Awaiting Approval"), [Date Flagged to AP]@row + 3, AND(OR([AP Payment Status]@row = "Payment Returned", [Date Flagged to AP]@row + 5))))

• ✭✭✭✭✭✭
Options

What is your criteria? How do you expect the formula to work exactly?

• ✭✭
Options

Hi Paul,

So when someone adds a date to the "Date Flagged to AP" column, and the status is updated, depending on the status a date will generate (ex: 3 days) to solve the issue, that will populate in the Date of Resolution (hopefully that makes sense)

• ✭✭✭✭✭✭
Options

I understand that's the general idea, but what is the exact logic? There are a number of syntax issues with the formula you posted, so I wasn't able to figure out exactly what you were expecting it to do. Are you able to list out each status and how many days would be added to each?

• ✭✭
Options

Sure no problem

Invalid Coding- 2 days

Reprocessed- 2 days

Invalid Approver- 2 days

Payment Rejected- 3 days

Awaiting Approval- 3 days

Payment Rejected- 5 days

• ✭✭✭✭✭✭
Options

Ok. Give this a try...

=[Date Flagged to AP]@row + IF(OR([AP Payment Status]@row = "Invalid Approver", [AP Payment Status]@row = "Reprocessed", [AP Payment Status]@row = "Invalid Coding"), 2, IF(OR([AP Payment Status]@row = "Payment Rejected", [AP Payment Status]@row = "Awaiting Approval"), 3, IF([AP Payment Status]@row = "Payment Returned", 5, 0)))

• ✭✭
Options

it worked!! thank you so much!!!

• ✭✭✭✭✭✭
Options

Happy to help. 👍️

## Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!