Skip to main content

#Formulas53 discussing

Hello, I am struggling to get a text formula field to display the corect information.  I have the following formula:     IF( AND(RecordType.Name = 'Asset', CONTAINS( ProductHierarchy__r.NRElement__r.Name, 'Water')),'Yes', 'No')     This is valid syntax, but every record is returning 'No', when there should be 'Yes' also.    I tried:    IF(CONTAINS(ProductHierarchy__r.NRElement__r.Name, "Water"), "Yes", "No")    as well, which was valid, but gave the same unexpected results   

5 answers
  1. Yesterday, 6:34 PM

    I should point out that the record type I am wanting to display a value against is one ('Site'), but the value/result is coming from 'Asset'.  So, If Site record 'A' contains an Asset Record A, B & C which is water related, then Site record A will contain water.  If Site 'A' doesn't contain any Asset records in it that are water related, then the result will be 'no'. 

    I should point out that the record type I am wanting to display a value against is one ('Site'), but the value/result is coming from 'Asset'.image.png

     

    My thought was I could create a formula lookup on asset record type, and then create another formula to display on site that looked up the value on assets within, but frustratingly salesforce won't let you create formulas looking up other formulas

0/9000

Hi fellow Trailblazers,    I'm attempting to create a validation rule that will fire if   1) the opportunity record type is not one particular type,  2) the amount field on an opportunity is null or 0,  and  3) the stage is one of four values    I inputted this text:  "AND( RecordType.Id<>"0120b000000udB0AAI",  OR( Amount =0,ISNULL(Amount)=TRUE),  OR( ISPICKVAL(StageName,"Pledged"),  ISPICKVAL(StageName,"Received"),  ISPICKVAL(StageName,"Awarded - Open"),  ISPICKVAL(StageName,"Awarded - Closed"))  )"    The validation rule is firing on opportunities that ARE the record type I specified in the first condition. Does anyone know why this is happening? Please help!   

4 answers
  1. May 14, 7:38 PM

    a few things:  

     

    First: Validation Rule Formulas can't read the full 18 character ID, they can only the 15 character ID  

     

    Second:  Don't use hard coded ID in Formulas, use RecordType Name or DeveloperName   

     

    Third:  Don't use ISNULL, that Function has been deprecated by Salesforce like 10+ years ago   

     

    I would write it like this

    AND(

    RecordType.Name <> 'Hi My Name Is',

    OR(

    Amount = 0,

    ISBLANK(Amount)

    ),

    CASE( StageName,

    'Pledged', 1,

    'Received', 1,

    'Awarded - Open', 1,

    'Awarded - Closed', 1,

    0 ) = 1

    )

0/9000

I'm trying to do a summary-level formula to work out an the average individual call rate per day, but the grand total row defaults to a sum

not an average, and I'm encountering validation errors whenever I try to do something. 

 

Screenshot 1 shows the basic call rate formula - number of rows/entries divided by the number of unique dates - fine. But in screenshot 3 you can see this

sums

in the grand total, whereas I want the average across the 7 users. 

 

Screenshot 2 I've tried to divide this by the number of Call Owners Unique - which gives the same numbers on an individual row level (dividing by 1), but dividing by 7 is giving the incorrect answer of 4.13 (the average of those numbers should be 8.47). I suspect the issue is to do with the "UNIQUE" criteria attached to the Call Date field - but if I remove this I get a validation error. 

 

ChatGPT suggests that creating a "Call Count" field within the Call object (where every entry just equals 1) will fix this issue as I can use for summing up the rows, but I don't understand how a SUM of this custom call count field would behave differently to "RowCount". 

 

Any advice greatly appreciated! 

Summary Level Formula - Grand Total?

 

 

callrate2.png

 

 

callrate1.png

 

 

2 answers
0/9000

Hi all, I created a field on tasks that is a checkbox to flag if an activity was created within business hours. Our business hours are 8am - 10pm EST. I am using the formula below, and this is working to pull tasks created between 8am and 8pm, however, because we are in EST and offset by 4, the value would go beyond 24 and not working. Anyone know how to flag tasks created between 8am and 10pm EST?? Thank you!!!!

 

(VALUE(LEFT(MID(TEXT(CreatedDate), 12, 5), 2)) + VALUE(RIGHT(MID(TEXT(CreatedDate), 12, 5), 2))/60) >= 12 && (VALUE(LEFT(MID(TEXT(CreatedDate), 12, 5), 2)) + VALUE(RIGHT(MID(TEXT(CreatedDate), 12, 5), 2))/60) <= 24

1 answer
  1. May 11, 4:22 PM

    Hi Meg, 

     

    This is due to the fact that string formula cannot deal with the UTC wrap-around. It would be simpler to shift the time prior to evaluating the hour. 

     

    Consider this: 

     

    HOUR(TIMEVALUE(CreatedDate - (4/24))) >= 8 && 

    HOUR(TIMEVALUE(CreatedDate - (4/24))) < 22 

     

    Why does it work? 

    Time Shifted: Shifting by 4/24 shifts UTC time to EST. 

    Error-Free: Salesforce takes care of the 24-hour wrapping internally; therefore, no errors occur at midnight. 

     

    Easier: Simply use the HOUR function rather than complicated string manipulation.

0/9000

Hello, 

 

I have a formula which currently calculates the difference between the Last Modified Date and the Date field (a custom Date field). Formula is: 

 

DATEVALUE(LastModifiedDate) - Date__c 

 

Formula is correct, so for the below record field "Gap Days" is calculated as follows: 

 

Gap Days= LastModifiedDate - Date__c= 8/5/26 - 28/5/26 = -20 

 

The "issue" is i am scratching my head whether it should be negative or just indicate the number "20". 

 

Question: Should i change it to "Date__c - LastModifiedDate" , so that it isn't negative? The Date field is a the date a salesperson has has a meeting so i'm guessing the LastModified will always be after the Meeting Date - Am i missing anything?

Formula Question/ Clarification

 

 

2.png

 

 

 

 

#Answers  #Formulas

2 answers
  1. May 10, 5:16 PM

    In any case, everything will depend on what you need the value of the 'Gap' to reflect. In case you need to determine how many days have gone after the meeting, then your formula is fine, only the returned result should be positive, otherwise you can simply move the dates in your formula around. In case you need just a positive value irrespective of what date is earlier, you can simply put an ABS function around your formula: 

     

    ABS(DATEVALUE(LastModifiedDate) - Date__c) 

     

    Now you won't need to change anything if someday a meeting date changes position!

0/9000

Hi all, 

 

im hoping someone may be able to assist, im trying to write a formula that'll calculate the amount of hours between two date time stamps in my org (Case on hold - Internal and Case off hold - Internal)

 

this is so that we can moniter our KPIs, there are a few consideration i have to consider which are as follows:

 - exclude saturdays and sundays from the calculation so if we have 2 weekends inbetween the two dates itll remove 96 hours from the calculation) 

- we have a cut off of 17:00 so if theyre marked as on hold after then, then itll start the hours counting from the following working day. 

 

i have tried various formulas but to no avail, i have even set up business hours within the sandbox but cannot seem to get anything to work how i want it to. 

 

any help is greatly appreciated. 

 

Kind regards

12 answers
  1. Eric Praud (Activ8 Solar Energies) Forum Ambassador
    Jan 15, 2025, 4:13 PM

    Apologies, I forgot to reply.

     

    I see a typo in my formula, there is a "8*60+300" that should be "8*60+30":

    ((DATEVALUE(date_time_2__c )-DATEVALUE(date_time_1__c )-1)*8.5

    +

    ((17*60+00)

    -

    (

    IF(CASE(WEEKDAY(DATEVALUE(date_time_1__c)),1,1,7,1,0)=1,8*60+30,

    MIN(17*60+00,

    MAX(HOUR(TIMEVALUE(date_time_1__c ))*60+MINUTE(TIMEVALUE(date_time_1__c )),8*60+30)))))/60

    +

    (

    IF(CASE(WEEKDAY(DATEVALUE(date_time_2__c)),1,1,7,1,0)=1,17*60+0,

    MIN((MAX(8*60+30,HOUR(TIMEVALUE(date_time_2__c ))*60+MINUTE(TIMEVALUE(date_time_2__c )))),(17*60+0)))

    -

    (8*60+30))/60)

    -

    8.5*(

    FLOOR((DATEVALUE(date_time_2__c)- DATEVALUE(date_time_1__c))/7)*2

    +

    IF(AND(WEEKDAY(DATEVALUE(date_time_1__c))=1, WEEKDAY(DATEVALUE(date_time_2__c))<>7),1,

    IF(CASE(WEEKDAY(DATEVALUE(date_time_1__c)),1,8,WEEKDAY(DATEVALUE(date_time_1__c)))>CASE(WEEKDAY(DATEVALUE(date_time_2__c)),1,8,WEEKDAY(DATEVALUE(date_time_2__c))),2,

    IF(OR (WEEKDAY(DATEVALUE(date_time_2__c))=7, WEEKDAY(DATEVALUE(date_time_1__c))=1),1,

    IF(OR (WEEKDAY(DATEVALUE(date_time_2__c))=1, WEEKDAY(DATEVALUE(date_time_1__c))=7),2,

    0))))

    )

    Also, it will return 0.25 in your example since it is only a quarter of an hour since 8.30 on the 14th. a quarter of 1(hour) returns 0.25 in my formula

0/9000
Advance Solution for convert OST to PST

If you are looking for the best way to convert OST to PST, then you need the best OST to PST Converter software solution to convert OST to PST. It Convert OST to PST very easily and gives you accessibility over corrupted or orphaned OST files through OST to PST conversion. The software can allow user to save the recovered email items in PST, MSG, EML, HTML, MHTML, and RTF.

More information visit: http://www.osttopstsolution.com/microsoft/

Advance Solution for convert OST to PST?
11 answers
0/9000

This approach solved my problem except I'm not having luck adding in more SUBSTITUTES.   

 

SUBSTITUTE({!$Record.FIELD__c} ,  LEFT( {!$Record.FIELD__c}  ,  FIND(".",  {!$Record.FIELD__c} )), "")

&SUBSTITUTE( {!$Record.FIELD__c}  ,  LEFT( {!$Record.FIELD__c}  ,  FIND("-",  {!$Record.FIELD__c} )), "")

&SUBSTITUTE( {!$Record.FIELD__c}  ,  LEFT( {!$Record.FIELD__c}  ,  FIND("/",  {!$Record.FIELD__c} )), "")

 

 I'm looking for a more efficient method so that I could just check to see if the field is A-Z and replace the special character.

 

@Bob Moalli

 

Any input greatly appreciated. 

5 answers
0/9000

Hi everyone! 

I'm trying to tweak a date field to have a default of 2

business

days added to newly created records (based on Created Date) but need some help.  Can anyone please advise how to make this work? 

 

TODAY() + CASE(MOD(TODAY() - DATE(1900, 1, 6), 7), 

5, 4, 

6, 3, 

2) 

 

 

#Formulas

6 answers
  1. Eric Burté (DEVOTEAM) Forum Ambassador
    Apr 12, 9:03 AM

    Hello @Mario Santellan, missed it was for a default value.  Indeed the record does not exist yet in this case, so no CreatedDate. Replace indeed the DATEVALUE(CreatedDate) by TODAY(), as you have done in your previous post :

    TODAY() +

    CASE(

    WEEKDAY(TODAY()),

    5, 4,

    6, 4,

    7, 3,

    2

    )

    Eric

0/9000
ATS NSF to PST Converter is a complete solution to migrate from Lotus Notes to MS Outlook, it is programmed to perform the conversion from NSF to PST without changing in its internal structure, it supports Lotus Notes version 9.0.1, 9.0, 8.5, 8.0.2, 7.0, 6.5, apart from supporting all the MS Outlook version from 2000, 2003, 2007, 2010, 2013 up to 2016 it also offers you to export your recovered NSF data into Office 365 and Live Exchange server. The users can save the recovered files into various format i.e. EMLX, EML MBOX, MSG, HTML, CSV, vCard. With the help of this tool you can convert single mailbox and multiple mailboxes, it also works even if MS Outlook is not present in your system. The amazing thing is that if you stuck at any point between the conversion process, the technical team always ready to help you.

See more:      https://gallery.technet.microsoft.com/Export-Lotus-Note-to-70bf698e

Migrate NSF file to PST File
13 answers
  1. Apr 24, 8:56 AM

    The Pcinfotools NSF to PST Converter provides users with an effective method to transform NSF files into PST format, which Outlook supports. This process enables users to transfer their data from IBM Lotus Notes to Outlook while maintaining all their essential information. Users should choose their desired NSF file through the provided selection option for conversion purposes. The program performs a file upload, which enables users to view mailbox contents that include emails and contacts and calendars and attachments. Users have the option to choose particular folders for conversion, or they can choose to convert all database content. Users should select PST as their desired output format while they designate a specific location for the resulting file. Users should initiate the process by selecting the Convert button. The tool provides secure and accurate conversion capabilities that maintain all folder structures and email formatting and metadata and attachments to ensure dependable 

0/9000