Mar 01, 2023 02:30 PM
I am working on a field that pulls a result based on a number range. I aim to convert the number of days from a person's hire date and an incident date to a set phrase such as "Less than 3 Months", "4 Months to 1 Year", etc. My first field converts the difference between their hire date and the incident date to the number of days. My thought was to create a formula that says if the number of days is between 0-90, then the result is "less than three months," and so forth. My fields are "Hire Date", "Incident Date", & "DateDiff". The field I need to formulate is "Length of Service". What is the best approach to get my outcome?
Solved! Go to Solution.
Mar 02, 2023 12:03 AM
Unfortunately you won't be able to use a SWITCH here and you'll need to use IFs like so:
IF(
AND({DateDiff} > 0, {DateDiff} <= 90),
"Less than 3 months",
IF(
AND(...
)
Mar 02, 2023 12:03 AM
Unfortunately you won't be able to use a SWITCH here and you'll need to use IFs like so:
IF(
AND({DateDiff} > 0, {DateDiff} <= 90),
"Less than 3 months",
IF(
AND(...
)
Mar 02, 2023 08:37 AM
I can't seem to add additional outcomes without getting an error. Here is the formula that works but adding another IF gives it an error. I am sure it is something simple. Is it best to copy and paste one of the IF lines then change the details?
Mar 03, 2023 03:08 AM
Could you provide a screenshot of the error you're seeing?
Mar 03, 2023 03:40 AM
Thanks for the response. I got it figured out! Do spaces affect how a formula operates? Wendy
Mar 03, 2023 06:30 AM
Like `IF({Field Name} = "Test", "Yes" , "No)`? If so, nope, they won't affect how the formula operates