Skip to main content
A call out to Formula Gurus!

 

I need to have a formula on an opportunity product that runs one sum if the product code starts with BRK and another sum for everything else as follows: 

 

IF product code starts with BRK then (End_Date__c - ServiceDate)* Number_of_Rooms__c

 

For all other codes then (End_Date__c - ServiceDate+1)* Number_of_Rooms__c

 

Formulas are my weakest area, thinking I may need to use CASE, does anyone have any advice, please?

 

Thanks so much

 

Tracy
2 个回答
  1. 2020年1月29日 12:08
    Hi Tracy, 

     

    This should work for you: 

    IF(

    LEFT(ProductCode,3)="BRK",

    (End_Date__c - ServiceDate)* Number_of_Rooms__c,

    (End_Date__c - ServiceDate+1)* Number_of_Rooms__c

    )