You need to sign in to do that
Don't have an account?

Custom Formula using IF, AND?
I need to write a formula that calcualtes payroll cycles for each of our Accounts. I have already written the formula below that works, but i need to write in an exception for one Account that basically says the same thing below, but changes the result number if the ACCOUNT= TEST.
IF(ISPICKVAL(Payroll_Cycle__c, "Weekly"), 52,
IF( ISPICKVAL(Payroll_Cycle__c, "Semi Monthly"), 24,
IF( ISPICKVAL(Payroll_Cycle__c, "Monthly"), 12,
IF( ISPICKVAL(Payroll_Cycle__c, "Biweekly"), 26, null
)
)
)
)
I tried to add this in, but it still calculates Biweekly as 26 instead of 24: IF(AND(ISPICKVAL(Payroll_Cycle__c, "Biweekly"), Account__c: ="Test"), 24,
Does anyone have any suggestions?
Message Edited by miss v on 04-14-2008 07:38 AM
Message Edited by miss v on 04-14-2008 07:44 AM
IF(ISPICKVAL(Payroll_Cycle__c, "Weekly"), 52,
IF( ISPICKVAL(Payroll_Cycle__c, "Semi Monthly"), 24,
IF( ISPICKVAL(Payroll_Cycle__c, "Monthly"), 12,
IF( ISPICKVAL(Payroll_Cycle__c, "Biweekly"), 26, null
)
)
)
)
I tried to add this in, but it still calculates Biweekly as 26 instead of 24: IF(AND(ISPICKVAL(Payroll_Cycle__c, "Biweekly"), Account__c: ="Test"), 24,
Does anyone have any suggestions?
Message Edited by miss v on 04-14-2008 07:38 AM
Message Edited by miss v on 04-14-2008 07:44 AM
IF(ISPICKVAL(Payroll_Cycle__c, "Weekly"), 52,
IF( ISPICKVAL(Payroll_Cycle__c, "Semi Monthly"), 24,
IF(AND(ISPICKVAL(Payroll_Cycle__c, "Biweekly"), Account__c ="AIMCO"), 24,
IF(AND(ISPICKVAL(Payroll_Cycle__c, "Biweekly"), NOT(Account__c ="AIMCO")), 26,
IF( ISPICKVAL(Payroll_Cycle__c, "Monthly"), 12, null
)
)
)
)
)
It always calculates 26 for Biweekly - ARGH!
Just for troubleshooting would you take out the line to see if 24 is possible? ,also confirm that Account__c is a text field that is a duplicate of the Account Name field:
IF(AND(ISPICKVAL(Payroll_Cycle__c, "Biweekly"), NOT(Account__c ="AIMCO")), 26,
However, you are right, when I removed the '26' line, this line failed to populate 24 - so there is something wrong with the way it is written.
IF(AND(ISPICKVAL(Payroll_Cycle__c, "Biweekly"), Account__c ="AIMCO"), 24,
Any insight?
Just noticed - Is there a missing ")" ?
IF(AND(ISPICKVAL(Payroll_Cycle__c, "Biweekly"), Account__c ="AIMCO"), 24,
IF(AND(ISPICKVAL(Payroll_Cycle__c, "Biweekly"), Account__c ="AIMCO")), 24,
It's definitely not a syntax error - it has to do with the formula expressions not being read correctly for some reason. I just can't figure it out. :(
I'm not really surprised that that was not it, I felt pretty confident from your previous posts that it was a copy and paste error, but I was grasping at straws.
I'm puzzled, but will keep thinking about this.
IF(ISPICKVAL(Payroll_Cycle__c, "Weekly"), 52,
IF( ISPICKVAL(Payroll_Cycle__c, "Semi Monthly"), 24,
IF(AND(ISPICKVAL(Payroll_Cycle__c, "Biweekly"), Account__c="0013000000DetVh"), 24,
IF( ISPICKVAL(Payroll_Cycle__c, "Biweekly"), 26,
IF( ISPICKVAL(Payroll_Cycle__c, "Monthly"), 12, null
)
)
)
)
)
Yipeee!
Thanks:smileyvery-happy: