Announcements
You can succeed best and quickest by helping others to succeed. Join the conversation.
cancel
Showing results for
Did you mean:
Creator III

## Help With If/And Statement

Hi,

I'm not very familiar with writing if statements. I have fields A, B, and C. I would like field C to be yellow(vColorDBWarn) if field A is greater than 5 days old and if field B contains a value(which would be a date in this case).

In another area I only wanted field C highlighted if field A was greater than 5 days old and successfully wrote:

=if(Today()-[Field A]>=5,vColorDBWarn)

I would appreciate any help in changing that statement to add the condition of field B containing a value.

Thanks!

Dan

1 Solution

Accepted Solutions
Creator III
Author

I tried your initial formula and two variations

Neither of these worked:

=If(Today()-[CapAdjPaid Dt]>=5 and (Len(Trim([CapAdjCeded Inv Dt])>0 or [CapAdjCeded Inv Dt]<>0)),ColorDBWarn)

This did work:

Thank you for the help!

6 Replies
MVP

May be this

If(Today() - FieldA >= 5 and (Len(Trim(FieldB)) > 0 or FieldB <> 0), vColorDBWarn)

Creator III
Author

I tried your initial formula and two variations

Neither of these worked:

=If(Today()-[CapAdjPaid Dt]>=5 and (Len(Trim([CapAdjCeded Inv Dt])>0 or [CapAdjCeded Inv Dt]<>0)),ColorDBWarn)

This did work:

Thank you for the help!

MVP

This would have worked had you not misplaced your parenthesis

=If(Today()-[CapAdjPaid Dt]>=5 and (Len(Trim([CapAdjCeded Inv Dt]))>0 or [CapAdjCeded Inv Dt]<>0)),ColorDBWarn)

Red is not needed and green was needed

MVP

But I wonder how this worked.... because this still have parenthesis issue....

Creator III
Author

It looks like they all match up in this case.
=