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
SherriASherriA 

Formula Help - evaluate 2 different fields

I'm trying to create a formula that will define where an order is in our process and I'm going in circles!  I need to evaluate 2 different custom fields and depending on the results, that will define where it is in the process.  

 

If the Order Packet Sent to OTR field is blank and the Approved for Booking Date is blank, then the field should say "In SMO".  

 

If the Order Packet Sent to OTR field is not blank and the Approved for Booking Date is blank, then the field should say "In OTR".  

 

If neither of these evaluates to true, then the field should say "Complete".  

 

I can write the individual expressions, but I can't figure out how to tie them together into a single formula.  Any help is appreciated!  

 

Below is my chicken scratch as I've tried to work through it, if that helps.  

 

 

 

AND( ISBLANK(Order_Packet_sent_to_OTR__c ), ISBLANK(  Approved_for_Booking_Date__c )) = "In SMO"

AND(NOT(( ISBLANK(Order_Packet_sent_to_OTR__c ), ISBLANK(  Approved_for_Booking_Date__c )) = "In OTR"

ELSE = "Completed"

 

Best Answer chosen by Admin (Salesforce Developers) 
Steve :-/Steve :-/

if it's a Text and a Date field this should work, if it's a Picklist or Checkbox it will have to be tweaked a bit  

IF(AND(ISBLANK(Order_Packet_sent_to_OTR__c),ISBLANK(Approved_for_Booking_Date__c)),"In SMO", 
IF(AND(NOT(ISBLANK(Order_Packet_sent_to_OTR__c)), ISBLANK(Approved_for_Booking_Date__c)) ,"In OTR",
"Completed"))

 

All Answers

Steve :-/Steve :-/

what are the datatype of each field in your formula?

SherriASherriA

They're both date fields

Steve :-/Steve :-/

if it's a Text and a Date field this should work, if it's a Picklist or Checkbox it will have to be tweaked a bit  

IF(AND(ISBLANK(Order_Packet_sent_to_OTR__c),ISBLANK(Approved_for_Booking_Date__c)),"In SMO", 
IF(AND(NOT(ISBLANK(Order_Packet_sent_to_OTR__c)), ISBLANK(Approved_for_Booking_Date__c)) ,"In OTR",
"Completed"))

 

This was selected as the best answer
SherriASherriA

Oy!  As easy as that?  I was assuming it would be much more complicated!  Thanks Steve.  I think I owe you another beer.  :)  

Steve :-/Steve :-/

just ONE?!?  ;-p

SherriASherriA

c'mon, you could have done that in your sleep...it's probably only really worth a LITE beer :smileywink:

 

Steve :-/Steve :-/

if you give me a Lite beer I will never answer one of your questions again (asleep or awake)  ;-p  

 

BTW - If you are going to Dreamforce '11 you DO owe me a few of these -> http://beeradvocate.com/beer/profile/863/7971