• 5 Hanshaw
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies
I've been scouring the forum and found some excellent help, so I've developed the following formula field in Salesforce:
 
IF( ISBLANK( Proposed_Space__c ) , "No space proposed.", (IF( INCLUDES( Proposed_Space__c , "Archibald - 200 Peak"), IF(nihrm__PeakRoomnightsAgreed__c > 200 , "Archibald ratio passed." + BR(), "Archibald ratio failed. "), "") &
IF( INCLUDES( Proposed_Space__c , " Cochran - 100 Peak"), IF(nihrm__PeakRoomnightsAgreed__c > 100 , "Cochran ratio passed." + BR(), "Cochran ratio failed. "), "") &
IF( INCLUDES( Proposed_Space__c , " Archibald/Cochran - 300 Peak"), IF(nihrm__PeakRoomnightsAgreed__c > 300 , "Archibald/Cochran ratio passed." + BR(), " Archibald/Cochran ratio failed."), "") &
IF( INCLUDES( Proposed_Space__c , "All West Tower Meeting Space - 400 Peak"), IF(nihrm__PeakRoomnightsAgreed__c > 400 , "West Tower ratio passed." + BR(), "West Tower ratio failed. "), "") &
IF( INCLUDES( Proposed_Space__c , "Ballroom A - 300 Peak"), IF(nihrm__PeakRoomnightsAgreed__c > 300 , "Ballroom A ratio passed." + BR(), "Ballroom A ratio failed. "), "") &
IF( INCLUDES( Proposed_Space__c , "Ballroom B - 150 Peak"), IF(nihrm__PeakRoomnightsAgreed__c > 150 , "Ballroom B ratio passed." + BR(), "Ballroom B ratio failed. "), "") &
IF( INCLUDES( Proposed_Space__c , "Ballroom C - 150 Peak"), IF(nihrm__PeakRoomnightsAgreed__c > 200 , "Ballroom C ratio passed." + BR(), "Ballroom C ratio failed. "), "")&
IF( INCLUDES( Proposed_Space__c , "Ballroom A/B - 450 Peak"), IF(nihrm__PeakRoomnightsAgreed__c > 450 , "Ballroom A/B ratio passed." + BR(), "Ballroom A/B ratio failed. "), "") &
IF( INCLUDES( Proposed_Space__c , "Ballroom B/C - 350 Peak "), IF(nihrm__PeakRoomnightsAgreed__c > 350 , "Ballroom B/C ratio passed." + BR(), "Ballroom B/C ratio failed. "), "") &
IF( INCLUDES( Proposed_Space__c , "All East Tower Meeting Space - 600 Peak "), IF(nihrm__PeakRoomnightsAgreed__c > 600 , "East Tower ratio passed." + BR(), "East Tower ratio failed. "), "") &
IF( INCLUDES( Proposed_Space__c , "Full Hotel Meeting Space - 900 Peak"), IF(nihrm__PeakRoomnightsAgreed__c > 900 , "Full Hotel ratio passed." + BR(), "Full Hotel ratio failed. "), "")))

It works if I use no values (blank). It works if I have one value, no matter which value it is, so it's clearly running through the full IF stack. However, I've found an issue when putting in multiple values in the picklist. I put in a first value and it spits out the right answer for that one (Ballroom A/B in the below example). Then I go add a second option (higher on the list than the original, if that makes a difference; see 1/2 numbers below.). The custom Auto Rooms to Space field doesn't update (see below).

User-added image

Can anyone provide some insight?
I've been scouring the forum and found some excellent help, so I've developed the following formula field in Salesforce:
 
IF( ISBLANK( Proposed_Space__c ) , "No space proposed.", (IF( INCLUDES( Proposed_Space__c , "Archibald - 200 Peak"), IF(nihrm__PeakRoomnightsAgreed__c > 200 , "Archibald ratio passed." + BR(), "Archibald ratio failed. "), "") &
IF( INCLUDES( Proposed_Space__c , " Cochran - 100 Peak"), IF(nihrm__PeakRoomnightsAgreed__c > 100 , "Cochran ratio passed." + BR(), "Cochran ratio failed. "), "") &
IF( INCLUDES( Proposed_Space__c , " Archibald/Cochran - 300 Peak"), IF(nihrm__PeakRoomnightsAgreed__c > 300 , "Archibald/Cochran ratio passed." + BR(), " Archibald/Cochran ratio failed."), "") &
IF( INCLUDES( Proposed_Space__c , "All West Tower Meeting Space - 400 Peak"), IF(nihrm__PeakRoomnightsAgreed__c > 400 , "West Tower ratio passed." + BR(), "West Tower ratio failed. "), "") &
IF( INCLUDES( Proposed_Space__c , "Ballroom A - 300 Peak"), IF(nihrm__PeakRoomnightsAgreed__c > 300 , "Ballroom A ratio passed." + BR(), "Ballroom A ratio failed. "), "") &
IF( INCLUDES( Proposed_Space__c , "Ballroom B - 150 Peak"), IF(nihrm__PeakRoomnightsAgreed__c > 150 , "Ballroom B ratio passed." + BR(), "Ballroom B ratio failed. "), "") &
IF( INCLUDES( Proposed_Space__c , "Ballroom C - 150 Peak"), IF(nihrm__PeakRoomnightsAgreed__c > 200 , "Ballroom C ratio passed." + BR(), "Ballroom C ratio failed. "), "")&
IF( INCLUDES( Proposed_Space__c , "Ballroom A/B - 450 Peak"), IF(nihrm__PeakRoomnightsAgreed__c > 450 , "Ballroom A/B ratio passed." + BR(), "Ballroom A/B ratio failed. "), "") &
IF( INCLUDES( Proposed_Space__c , "Ballroom B/C - 350 Peak "), IF(nihrm__PeakRoomnightsAgreed__c > 350 , "Ballroom B/C ratio passed." + BR(), "Ballroom B/C ratio failed. "), "") &
IF( INCLUDES( Proposed_Space__c , "All East Tower Meeting Space - 600 Peak "), IF(nihrm__PeakRoomnightsAgreed__c > 600 , "East Tower ratio passed." + BR(), "East Tower ratio failed. "), "") &
IF( INCLUDES( Proposed_Space__c , "Full Hotel Meeting Space - 900 Peak"), IF(nihrm__PeakRoomnightsAgreed__c > 900 , "Full Hotel ratio passed." + BR(), "Full Hotel ratio failed. "), "")))

It works if I use no values (blank). It works if I have one value, no matter which value it is, so it's clearly running through the full IF stack. However, I've found an issue when putting in multiple values in the picklist. I put in a first value and it spits out the right answer for that one (Ballroom A/B in the below example). Then I go add a second option (higher on the list than the original, if that makes a difference; see 1/2 numbers below.). The custom Auto Rooms to Space field doesn't update (see below).

User-added image

Can anyone provide some insight?
Hi, 

I need to get this logical formual in salesforce formula. 

Below is the logical formula. 

(365 – ( MIN(365,MAX(0,LSD-FYSD)) + MIN(365,MAX (0,FYED-LED)))*100)/365

Here 
LSD , FYSD, FYED LED are date fields. 

Please suggest me how to put this inside a salesforce formula field. 

Thanks
Sudhir
  • April 21, 2020
  • Like
  • 0