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
jwest2jwest2 

Need help creating a basic formula!

My customer is having diffculty developing the following formula(s).  HELP!!
 
Hello -
I wanted to know if someone could help me with a formula as I've been struggling with it. Here are the details:

OBJECT = Tech validation (this is a custom object we have created)
REFERENCE FIELD = Total Hours (this is a field that calculates the total amount of hours or Sales Engineers are working on a particular Tech Validation)
FORMULA = I'm attempting to create a custom field (called HOUR BUCKET) that is a TEXT FORMULA field that will take the "TOTAL HOURS" and break it out into buckets.
For example - in English this is how the formula would be:

1.) If "Total Hours" is less than or equal to 40 hours = the HOUR BUCKET should populate with "40 hours or less"
-or-
2.) if "Total Hours" is more than 40 AND less than 100 hours = the HOUR BUCKET should populate with "41 - 99 hours"
- or -
3.) if "Total Hours" is more than 99 AND less than 500 hours = the HOUR BUCKET should populate with "100 - 499 hours"
- or -
4.) If "Total Hours" is greater than 499 = the HOUR BUCKET should populate with "500+ hours"

I'm having trouble with all the "ANDS" and "ORs" and "IFs" and where to put the appropriate quotes and parenthesis.

 
CaptainObviousCaptainObvious
Keeping track of the parenthesis, quotes, IF's AND's, OR's can be challenging. Start with the basics, then add the conditions. Check the syntax after adding each new condition.. Copy the formula somewhere  before making edits (i.e. notepad?).
 
Anyway, see if this helps:
 
Code:
If( Total_Hours__c  <= 40,"40 hours or less", 
 If( AND (Total_Hours__c  >40,Hours__c < 100),"41 - 99 hours", 
  If( AND (Total_Hours__c  >99,Hours__c < 500),"100 - 499 hours",
   If( Total_Hours__c  >499,"500+ hours",""
   )
  )
 )
)


 
 
RainManRainMan
Sorry... i totally misread this was a formula.  Ignore the new guy.


Message Edited by RainMan on 10-23-2008 11:20 AM