You need to sign in to do that
Don't have an account?
jisaac
another If and OR conundrum
I want to create a formula the enters a the following percentage based on a picklist (default is 20) unless the product line is one of those specified.
Here's what I have tried so far:
IF(ISPICKVAL(OSI_Business_Unit__c , "CSG Bank Acct Mgmt", "CSG Bank Sales",34, 20),
IF(ISPICKVAL(OSI_Business_Unit__c , "CSG CU Acct Mgmt", "CSG CU Sales - Major","OSC-BSG","OSC Core AM",30, 20),
IF(ISPICKVAL(OSI_Business_Unit__c , "IPTG Acct Mgmt", "IPTG Sales",15, 20), 20),
IF( ISPICKVAL( Product_Line__c , "Internet - In-House", "Internet - ASP", "Lending - Consumer Streamlend", "Lending - Consumer Velocity", "Lending - Commercial Velocity","Lending - Velocity Conversion", 40, 20),20)
)
)
but I keep getting syntax errors - can someone show me how to write this?
OSI Business Units (picklist) | |||
CSG Bank Acct Mgmt | 34 | ||
CSG Bank Sales | 34 | ||
CSG CU Acct Mgmt | 30 | ||
CSG CU Sales - Major | 30 | ||
INTL | 30 | ||
IPTG Acct Mgmt | 15 | ||
IPTG Sales | 15 | ||
OSC-BSG | 30 | ||
OSC Core AM | 30 | ||
All Others | 20 | ||
except when the opportunity is for one of these Product Lines | |||
Product Line (picklist) | |||
Internet - ASP | 40 | ||
Internet - In-House | 40 | ||
Lending - Commercial Velocity | 40 | ||
Lending - Consumer Streamlend | 40 | ||
Lending - Consumer Velocity | 40 | ||
Lending - Velocity Conversion | 40 |
Here's what I have tried so far:
IF(ISPICKVAL(OSI_Business_Unit__c , "CSG Bank Acct Mgmt", "CSG Bank Sales",34, 20),
IF(ISPICKVAL(OSI_Business_Unit__c , "CSG CU Acct Mgmt", "CSG CU Sales - Major","OSC-BSG","OSC Core AM",30, 20),
IF(ISPICKVAL(OSI_Business_Unit__c , "IPTG Acct Mgmt", "IPTG Sales",15, 20), 20),
IF( ISPICKVAL( Product_Line__c , "Internet - In-House", "Internet - ASP", "Lending - Consumer Streamlend", "Lending - Consumer Velocity", "Lending - Commercial Velocity","Lending - Velocity Conversion", 40, 20),20)
)
)
but I keep getting syntax errors - can someone show me how to write this?
I did as you suggested - one If statement at a time - thanks for your help and suggestions!
Jane
if(
or(
ispickval( Product_Line__c ,"Internet - ASP")
,ispickval(Product_Line__c ,"Internet - In-House")
,ispickval(Product_Line__c ,"Internet - In-House")
,ispickval(Product_Line__c ,"Lending - Commercial Velocity")
,ispickval(Product_Line__c ,"Lending - Consumer Streamlend")
,ispickval(Product_Line__c ,"Lending - Consumer Velocity")
,ispickval(Product_Line__c ,"Lending - Velocity Conversion")
), 40
,if(
or(
ispickval( OSI_Business_Unit__c ,"CSG CU Sales - Major")
,ispickval(OSI_Business_Unit__c ,"INTL")
,ispickval(OSI_Business_Unit__c ,"OSC Core AM")
,ispickval(OSI_Business_Unit__c ,"OSC-BSG")
,ispickval(OSI_Business_Unit__c ,"CSG CU Acct Mgmt")
), 30
,if(
or(
ispickval(OSI_Business_Unit__c ,"CSG Bank Acct Mgmt")
,ispickval(OSI_Business_Unit__c ,"CSG Bank Sales")
), 34
,if(
or(
ispickval(OSI_Business_Unit__c ,"IPTG Acct Mgmt")
,ispickval(OSI_Business_Unit__c ,"IPTG Sales")
), 15,20
)
)
)
)
All Answers
Message Edited by jisaac on 10-03-2008 01:08 PM
I really appreciate your help on this and I like the way you lay it out. I think we are close but still a problem:
Here's what I did so far and I am getting an error message: "Incorrect number of parameters for Function IF(). Expected 3, Received 2." Any idea where and why?
if(
or(
ispickval( Product_Line__c ,"Internet - ASP")
,ispickval(Product_Line__c ,"Internet - In-House")
,ispickval(Product_Line__c ,"Internet - In-House")
,ispickval(Product_Line__c ,"Lending - Commercial Velocity")
,ispickval(Product_Line__c ,"Lending - Consumer Streamlend")
,ispickval(Product_Line__c ,"Lending - Consumer Velocity")
,ispickval(Product_Line__c ,"Lending - Velocity Conversion")
), 40
,if(
or(
ispickval( OSI_Business_Unit__c ,"CSG CU Sales - Major")
,ispickval(OSI_Business_Unit__c ,"INTL")
,ispickval(OSI_Business_Unit__c ,"OSC Core AM")
,ispickval(OSI_Business_Unit__c ,"OSC-BSG")
,ispickval(OSI_Business_Unit__c ,"CSG CU Acct Mgmt")
), 30
,if(
or(
ispickval(OSI_Business_Unit__c ,"CSG Bank Acct Mgmt")
,ispickval(OSI_Business_Unit__c ,"CSG Bank Sales")
), 34
,if(
or(
ispickval(OSI_Business_Unit__c ,"IPTG Acct Mgmt")
,ispickval(OSI_Business_Unit__c ,"IPTG Sales")
), 15
),20
)
)
)
You're welcome-
I'm pretty sure all you need to do is put the ",20" towards the bottom of the formula after the second-to-last close parenthesis, like so:
Any other ideas?
Work backwards. Start with just one if() and get it working. Then add an or() into it, then add another if(). The basic ideas are these:
If(logical test, what to do if true, what to do if false)
Or(logical test, logical test, logical test, etc) - if any of the tests are True, then you get a True result.
So, here's a simple if() example:
In order to add additional If() statements, you replace the spot where I've been putting a 0 (the "what to do if the logical test is false" area) with a new If() statement.
Everything else is just testing, carefully adding on, counting parenthesis, and a fair amount of cussing <grin>.
Good luck!
-Jake
I did as you suggested - one If statement at a time - thanks for your help and suggestions!
Jane
if(
or(
ispickval( Product_Line__c ,"Internet - ASP")
,ispickval(Product_Line__c ,"Internet - In-House")
,ispickval(Product_Line__c ,"Internet - In-House")
,ispickval(Product_Line__c ,"Lending - Commercial Velocity")
,ispickval(Product_Line__c ,"Lending - Consumer Streamlend")
,ispickval(Product_Line__c ,"Lending - Consumer Velocity")
,ispickval(Product_Line__c ,"Lending - Velocity Conversion")
), 40
,if(
or(
ispickval( OSI_Business_Unit__c ,"CSG CU Sales - Major")
,ispickval(OSI_Business_Unit__c ,"INTL")
,ispickval(OSI_Business_Unit__c ,"OSC Core AM")
,ispickval(OSI_Business_Unit__c ,"OSC-BSG")
,ispickval(OSI_Business_Unit__c ,"CSG CU Acct Mgmt")
), 30
,if(
or(
ispickval(OSI_Business_Unit__c ,"CSG Bank Acct Mgmt")
,ispickval(OSI_Business_Unit__c ,"CSG Bank Sales")
), 34
,if(
or(
ispickval(OSI_Business_Unit__c ,"IPTG Acct Mgmt")
,ispickval(OSI_Business_Unit__c ,"IPTG Sales")
), 15,20
)
)
)
)
Jane
Message Edited by jisaac on 10-07-2008 04:14 PM