Help

Re: Formula, If / Or Help

755 0
cancel
Showing results for 
Search instead for 
Did you mean: 
K_B1
5 - Automation Enthusiast
5 - Automation Enthusiast

I am trying to generate a formula where:

1. If date in field x is greater than 1953, then 1 is put in field z

OR

2. If checkbox is checked in field y, then 1 is put in field z

I came up with this formula

IF(OR({NO DIGITAL} = 0), ({CODE-DATE} > 1953), "1")

However, this is producing a statement that reads 'true' if {CODE-DATE} > 1953, and '1' if {NO DIGITAL} = 0 (that is to say, box in {NO DIGITAL} is checked)

Any idea why this is happening or how to get the results I want?

4 Replies 4
patrick-F
6 - Interface Innovator
6 - Interface Innovator

Hi @K_B1,

here we have a simple syntax error. The or statement only looks at {NO DIGITAL} = 0. As a result you have the following:

  • If the value of the checkbox is true, it will print the result of this operation in the formula field: {CODE-DATE} > 1953 which in your example is true.
  • If the statement is false it will print 1

Assuming that you want to print a 0 if both statements are not true, the formula should look like this:

IF(OR({NO DIGITAL} = 0, {CODE-DATE} > 1953), 1, 0)

Let me know if it works!
Best, Patrick @Monino Solutions

K_B1
5 - Automation Enthusiast
5 - Automation Enthusiast

what if I want it to do nothing if both statements are false?

 

K_B1
5 - Automation Enthusiast
5 - Automation Enthusiast

Got it working.  Thanks!

 

patrick-F
6 - Interface Innovator
6 - Interface Innovator

Then the formula should include an empty string like below:

IF(OR({NO DIGITAL} = 0, {CODE-DATE} > 1953), 1, "") 

Let me know if that works. 

Best,

Patrick