Help Needed with a Formula..

  • 0
  • 1
  • Question
  • Updated 4 years ago
  • Answered

I need help writing a formula.

Here is what I have. It is a sales table so it has basic sales fields.

I need the formula to held in a date formula field called "Renewal Date"

So, this date formula needs to:

Look at the product name > if it contains the text "Certified" or "MicroDegree" in the product name.

Then add 365 days (ie 1 year) to the purchase date. Which will end up being a renewal date in this field.

I hope that makes sense.

Photo of Joshua McAfee

Joshua McAfee

  • 0 Points

Posted 4 years ago

  • 0
  • 1
Photo of dwhawe

dwhawe, Champion

  • 908 Points 500 badge 2x thumb
This is untested:

If(

Contains([Product Name],"Certified",AdjustYear([Purchase Date],1),

Contains([Product Name],"MicroDegree",AdjustYear([Purchase Date],1))
Photo of Joshua McAfee

Joshua McAfee

  • 0 Points
Thank you buddy.

I changed it slightly due to the field names
If(
Contains([Product Name],"Certified", AdjustYear([Order Date],1),
Contains([Product Name],"MicroDegree", AdjustYear([Order Date],1)
)

But its throwing a syntax error. Any advice would be great.
Photo of dwhawe

dwhawe, Champion

  • 908 Points 500 badge 2x thumb
What is the error?  I made the suggestion based on assuming it is a formula-date field.
Photo of dwhawe

dwhawe, Champion

  • 908 Points 500 badge 2x thumb
Close the parenthesis after closing quotes of Certified and MicroDegree
Photo of Joshua McAfee

Joshua McAfee

  • 0 Points
Formula syntax error

Please check the syntax of your entire formula. Possible culprits are a mismatched set of parentheses, missing quotes, or an extra bracket.


If(
Contains ([Product Name],"Certified", AdjustYear([Order Date],1),
Contains ([Product Name],"MicroDegree", AdjustYear([Order Date],1)
)  

More on syntax errors...
Photo of dwhawe

dwhawe, Champion

  • 908 Points 500 badge 2x thumb
Close the parenthesis after closing quotes of Certified and MicroDegree

If(
Contains ([Product Name],"Certified"), AdjustYear([Order Date],1),
Contains ([Product Name],"MicroDegree"), AdjustYear([Order Date],1)
)
Photo of dwhawe

dwhawe, Champion

  • 908 Points 500 badge 2x thumb
That was my error
Photo of Joshua McAfee

Joshua McAfee

  • 0 Points
I think that might have fixed it testing it now.
Photo of Joshua McAfee

Joshua McAfee

  • 0 Points
I think that worked. Thank you VERY MUCH, my friend..
Photo of dwhawe

dwhawe, Champion

  • 908 Points 500 badge 2x thumb
Happy to be able to help.