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
Amanda JonesAmanda Jones 

How to make one IF Statement apply to all others?

Hello!

I am trying to update a formula field so that one if statement adds a dollar amount to all of the others. 

Here is the statement that should apply to all of the others IF(Extra_Night__c =True), 15.00

But I can't get it to work when I add it in. When I check the Extra Night box, it only returns the 15.00 value, not the 15.00 plus the other amounts.

IF( 

ISPICKVAL(Status, "Cancelled"),0, 

IF((

ISPICKVAL (UP_City__c,"Dallas, TX")&&NumberSent>10 && UP_Auto_Number_of_Nights__c>= 4||
ISPICKVAL(UP_City__c,"Des Moines, IA")&&NumberSent>10 && UP_Auto_Number_of_Nights__c>= 4|| 
ISPICKVAL(UP_City__c, "Kansas City, MO")&&NumberSent>10 && UP_Auto_Number_of_Nights__c>= 4|| 
ISPICKVAL(UP_City__c, "Sioux Falls, SD")&&NumberSent>10 && UP_Auto_Number_of_Nights__c>= 4||
ISPICKVAL(UP_City__c, "Ocean Beach, CA")&&NumberSent>10 && UP_Auto_Number_of_Nights__c>= 4||
ISPICKVAL(UP_City__c, "Storm Lake, IA")&&NumberSent>10 && UP_Auto_Number_of_Nights__c>= 4||
ISPICKVAL(UP_City__c, "Phoenix, AZ")&&NumberSent>10 && UP_Auto_Number_of_Nights__c>= 4||
ISPICKVAL(UP_City__c, "Las Vegas, NV")&&NumberSent>10 && UP_Auto_Number_of_Nights__c>= 4||
ISPICKVAL(UP_City__c, "Chicago, IL")&&NumberSent>10 && UP_Auto_Number_of_Nights__c>= 4||
ISPICKVAL(UP_City__c, "Lincoln, NE")&&NumberSent>10 && UP_Auto_Number_of_Nights__c>= 4
), 20.00*NumberSent, 

IF(VALUE(TEXT(Year__c))>=2018 &&ISPICKVAL(UP_City__c,"Omaha, NE")&&ISPICKVAL(Coordinator_First_Name__c,"Jordan"), 90.00,

IF (VALUE(TEXT(Year__c))<=2018 &&ISPICKVAL(UP_City__c,"Omaha, NE")&&ISPICKVAL(Coordinator_First_Name__c, "Marcus"),75.00,

IF (VALUE(TEXT(Year__c))>=2019 &&ISPICKVAL(UP_City__c,"Omaha, NE")&&ISPICKVAL(Coordinator_First_Name__c, "Marcus"),80.00,

IF (UP_Auto_Number_of_Nights__c<1 && NumberSent>10 ,5.00*NumberSent,

IF (UP_Auto_Number_of_Nights__c<1 && NumberSent<=10,5.00*10,

IF (UP_Auto_Number_of_Nights__c=2&& NumberSent<=10, 15.00*10,

IF (UP_Auto_Number_of_Nights__c=2 && NumberSent>10 ,15.00*NumberSent,

IF (UP_Auto_Number_of_Nights__c=3&& NumberSent<=10, 15.00*10,

IF (UP_Auto_Number_of_Nights__c=3&& NumberSent>10 ,15.00*NumberSent,

 20.00*10 


)))))))))))
Best Answer chosen by Amanda Jones
Raj VakatiRaj Vakati
Try some think like below 
 
IF( 

ISPICKVAL(Status, "Cancelled"),0, 

IF((

ISPICKVAL (UP_City__c,"Dallas, TX")&&NumberSent>10 && UP_Auto_Number_of_Nights__c>= 4||
ISPICKVAL(UP_City__c,"Des Moines, IA")&&NumberSent>10 && UP_Auto_Number_of_Nights__c>= 4|| 
ISPICKVAL(UP_City__c, "Kansas City, MO")&&NumberSent>10 && UP_Auto_Number_of_Nights__c>= 4|| 
ISPICKVAL(UP_City__c, "Sioux Falls, SD")&&NumberSent>10 && UP_Auto_Number_of_Nights__c>= 4||
ISPICKVAL(UP_City__c, "Ocean Beach, CA")&&NumberSent>10 && UP_Auto_Number_of_Nights__c>= 4||
ISPICKVAL(UP_City__c, "Storm Lake, IA")&&NumberSent>10 && UP_Auto_Number_of_Nights__c>= 4||
ISPICKVAL(UP_City__c, "Phoenix, AZ")&&NumberSent>10 && UP_Auto_Number_of_Nights__c>= 4||
ISPICKVAL(UP_City__c, "Las Vegas, NV")&&NumberSent>10 && UP_Auto_Number_of_Nights__c>= 4||
ISPICKVAL(UP_City__c, "Chicago, IL")&&NumberSent>10 && UP_Auto_Number_of_Nights__c>= 4||
ISPICKVAL(UP_City__c, "Lincoln, NE")&&NumberSent>10 && UP_Auto_Number_of_Nights__c>= 4
), 20.00*NumberSent, 

IF(VALUE(TEXT(Year__c))>=2018 &&ISPICKVAL(UP_City__c,"Omaha, NE")&&ISPICKVAL(Coordinator_First_Name__c,"Jordan"), 90.00,

IF (VALUE(TEXT(Year__c))<=2018 &&ISPICKVAL(UP_City__c,"Omaha, NE")&&ISPICKVAL(Coordinator_First_Name__c, "Marcus"),75.00,

IF (VALUE(TEXT(Year__c))>=2019 &&ISPICKVAL(UP_City__c,"Omaha, NE")&&ISPICKVAL(Coordinator_First_Name__c, "Marcus"),80.00,

IF (UP_Auto_Number_of_Nights__c<1 && NumberSent>10 ,5.00*NumberSent,

IF (UP_Auto_Number_of_Nights__c<1 && NumberSent<=10,5.00*10,

IF (UP_Auto_Number_of_Nights__c=2&& NumberSent<=10, 15.00*10,

IF (UP_Auto_Number_of_Nights__c=2 && NumberSent>10 ,15.00*NumberSent,

IF (UP_Auto_Number_of_Nights__c=3&& NumberSent<=10, 15.00*10,

IF (UP_Auto_Number_of_Nights__c=3&& NumberSent>10 ,15.00*NumberSent,

 20.00*10 


)))))))))))
+
IF(Extra_Night__c =True,15.00,0)

 

All Answers

Raj VakatiRaj Vakati
Try some think like below 
 
IF( 

ISPICKVAL(Status, "Cancelled"),0, 

IF((

ISPICKVAL (UP_City__c,"Dallas, TX")&&NumberSent>10 && UP_Auto_Number_of_Nights__c>= 4||
ISPICKVAL(UP_City__c,"Des Moines, IA")&&NumberSent>10 && UP_Auto_Number_of_Nights__c>= 4|| 
ISPICKVAL(UP_City__c, "Kansas City, MO")&&NumberSent>10 && UP_Auto_Number_of_Nights__c>= 4|| 
ISPICKVAL(UP_City__c, "Sioux Falls, SD")&&NumberSent>10 && UP_Auto_Number_of_Nights__c>= 4||
ISPICKVAL(UP_City__c, "Ocean Beach, CA")&&NumberSent>10 && UP_Auto_Number_of_Nights__c>= 4||
ISPICKVAL(UP_City__c, "Storm Lake, IA")&&NumberSent>10 && UP_Auto_Number_of_Nights__c>= 4||
ISPICKVAL(UP_City__c, "Phoenix, AZ")&&NumberSent>10 && UP_Auto_Number_of_Nights__c>= 4||
ISPICKVAL(UP_City__c, "Las Vegas, NV")&&NumberSent>10 && UP_Auto_Number_of_Nights__c>= 4||
ISPICKVAL(UP_City__c, "Chicago, IL")&&NumberSent>10 && UP_Auto_Number_of_Nights__c>= 4||
ISPICKVAL(UP_City__c, "Lincoln, NE")&&NumberSent>10 && UP_Auto_Number_of_Nights__c>= 4
), 20.00*NumberSent, 

IF(VALUE(TEXT(Year__c))>=2018 &&ISPICKVAL(UP_City__c,"Omaha, NE")&&ISPICKVAL(Coordinator_First_Name__c,"Jordan"), 90.00,

IF (VALUE(TEXT(Year__c))<=2018 &&ISPICKVAL(UP_City__c,"Omaha, NE")&&ISPICKVAL(Coordinator_First_Name__c, "Marcus"),75.00,

IF (VALUE(TEXT(Year__c))>=2019 &&ISPICKVAL(UP_City__c,"Omaha, NE")&&ISPICKVAL(Coordinator_First_Name__c, "Marcus"),80.00,

IF (UP_Auto_Number_of_Nights__c<1 && NumberSent>10 ,5.00*NumberSent,

IF (UP_Auto_Number_of_Nights__c<1 && NumberSent<=10,5.00*10,

IF (UP_Auto_Number_of_Nights__c=2&& NumberSent<=10, 15.00*10,

IF (UP_Auto_Number_of_Nights__c=2 && NumberSent>10 ,15.00*NumberSent,

IF (UP_Auto_Number_of_Nights__c=3&& NumberSent<=10, 15.00*10,

IF (UP_Auto_Number_of_Nights__c=3&& NumberSent>10 ,15.00*NumberSent,

 20.00*10 


)))))))))))
+
IF(Extra_Night__c =True,15.00,0)

 
This was selected as the best answer
Amanda JonesAmanda Jones
That did it! Thank you so much Raj!