function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ritu vyasritu vyas 

How to use contains function correctly

Tried using contain as per below but not sure why it is not returning correct value 
this is returning F when running it on 15.03.2020  , whereas the excepted result is T since its 3rd month and is in the list
IF((CONTAINS(TEXT(MONTH(TODAY())), "1:3:5:7:8:10:12")),"T" , "F")
Abdul KhatriAbdul Khatri
Hi ritu,

Just swap the values like this
IF((CONTAINS("1:3:5:7:8:10:12", TEXT(MONTH(TODAY())))),"T" , "F")
Andrew GAndrew G
Hi Ritu

If we think of Contains formula from basic concept:
CONTAINS(text, compare_text)
CONTAINS will return TRUE if "compare_text" is found in "text" and FALSE if not.
If we look at your format, you are looking for 1:3:5:7:8:10:12" in the Today field - so you are looking for a list in a single digit

If we twist the formula:
IF(
  CONTAINS("1:3:5:7:8:10:12",TEXT(MONTH( Date_Field_One__c ))),
  True , 
  False 
)

this way we are looking for a single digit in a list of digits

HTH

AndrewG