IF AND FUNCTION
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello
Sorry this may be a really basic question but I am trying to do an "IF AND" with the below working formula - I need to add IF [TP Uplift]="-1" AND Contains(and then the rest of the below)... but I can't seem to get it to work. I have tried IF ELSEIF and IF(AND(... but it won't work. How would you do this?
IF Contains([BOARDREP code], "STAFF",1)
THEN [Base Cost EUR] * (1 + [TP Uplift]) ELSE [Base Cost EUR]
ENDIF
Thank you!
- Labels:
- Common Use Cases
- Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
IF Contains([BOARDREP code], "STAFF",1) AND [TP Uplift] = "-1"
THEN [Base Cost EUR] * (1 + [TP Uplift]) ELSE [Base Cost EUR]
ENDIF
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Is [TP Uplift]="-1" a String field? If it isn't then you need to remove the quotes. This could be the issue you are having. Otherwise you should have no issue adding the AND. Seeing as you are performing a calculation on the field you likely need to remove the quotes as per below.
IF [TP Uplift] = -1 AND Contains([BOARDREP code], "STAFF",1)
THEN [Base Cost EUR] * (1 + [TP Uplift]) ELSE [Base Cost EUR]
ENDIF
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I think you had a solution in the question
just nest the AND condition in Starting
IF Contains([BOARDREP code], "STAFF",1) AND [TP Uplift]="-1"
THEN [Base Cost EUR] * (1 + [TP Uplift]) ELSE [Base Cost EUR]
ENDIF
